「RってTwitterで遊ぶためのものなのか」とか思われるとあれなので、ちょいまじめネタで行くことにします。「株価データの収集、基本的なデータの解析、株価の予想モデルの作成まで全部Rでできちゃうよ」編です*1。 とりあえず、株価データの収集をしてくる関数から。infoseekのファイナンスのところから取ってきてます。 finance <- function(site){ ruby <- paste(" #!/usr/bin/ruby -Ke # -*- coding: utf-8 -*- require %q[rubygems] require %q[mechanize] require %q[kconv] finance = \"",site,"\" agent = WWW::Mechanize.new agent.max_history = 1 page = agent.get(fin
![そろそろRの本当の力を見せておくか - yasuhisa's blog](https://cdn-ak-scissors.b.st-hatena.com/image/square/463f3a47e96f7739fc03b169ccea0d1bb5405bba/height=288;version=1;width=512/http%3A%2F%2Fgyazo.com%2F481d94a855ff7e13de1c4884256ed84e.png)