Rによるビットコイン価格取得 ( 交換所:Bitstamp )

Reference - https://twitter.com/Rbloggers/status/662177625763221505
Script
library(RJSONIO)
url<-"https://www.bitstamp.net/api/transactions/"
bitcoinData<-fromJSON(url)
class(bitcoinData)
bitcoinData<-do.call(rbind,lapply(bitcoinData,data.frame,stringsAsFactors=FALSE))
bitcoinData$JST<-as.POSIXct(as.numeric(bitcoinData$date),origin="1970-01-01")
class(bitcoinData)
head(bitcoinData,10)
tail(bitcoinData,10)
# tid 取引ID、date タイムスタンプ(unix time)、price ビットコイン価格、amount 取引量、type  0:買 1:売
Result

> class(bitcoinData)
[1] "list"

> class(bitcoinData)
[1] "data.frame"

> head(bitcoinData,10)
         date     tid  price type     amount                 JST
1  1446716505 9727829 372.97    0 0.16412163 2015-11-05 18:41:45
2  1446716504 9727828 372.97    0 0.01060000 2015-11-05 18:41:44
3  1446716504 9727827 372.97    0 0.27000000 2015-11-05 18:41:44
4  1446716504 9727826 372.97    0 0.21940000 2015-11-05 18:41:44
5  1446716499 9727825 372.97    0 0.05060000 2015-11-05 18:41:39
6  1446716497 9727824 372.98    0 0.90150000 2015-11-05 18:41:37
7  1446716497 9727823 372.97    0 0.27100000 2015-11-05 18:41:37
8  1446716497 9727822 372.97    0 0.19500000 2015-11-05 18:41:37
9  1446716497 9727821 372.97    0 0.27200000 2015-11-05 18:41:37
10 1446716497 9727820 372.97    0 0.27300000 2015-11-05 18:41:37

> tail(bitcoinData,10)
           date     tid  price type     amount                 JST
1571 1446712964 9726178 382.00    1 9.27287585 2015-11-05 17:42:44
1572 1446712962 9726177 382.01    1 0.17808580 2015-11-05 17:42:42
1573 1446712961 9726176 382.01    1 0.17191420 2015-11-05 17:42:41
1574 1446712958 9726175 382.51    0 2.30000000 2015-11-05 17:42:38
1575 1446712958 9726174 382.40    0 0.35000000 2015-11-05 17:42:38
1576 1446712958 9726173 382.39    0 0.35000000 2015-11-05 17:42:38
1577 1446712931 9726172 382.00    1 7.70192415 2015-11-05 17:42:11
1578 1446712931 9726171 382.02    1 1.27807585 2015-11-05 17:42:11
1579 1446712931 9726170 382.03    1 0.02000000 2015-11-05 17:42:11
1580 1446712923 9726169 382.15    0 5.00000000 2015-11-05 17:42:03