R 語言 reference/Memo

Posted in Daily on May 9th, 2016 by Banbanli

Try to install the module “quandmod”

>library(quantmod)
>getSymbols("AAPL")
[1] "AAPL"
Warning message:
In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, :
downloaded length 171720 != reported length 200

>AAPL
2016-05-10 93.33 93.57 92.11 93.42 33592500 93.42000
2016-05-11 93.48 93.57 92.46 92.51 28539900 92.51000
2016-05-12 92.72 92.78 89.47 90.34 76109800 90.34000
2016-05-13 90.00 91.67 90.00 90.52 44188200 90.52000
2016-05-16 92.39 94.39 91.65 93.88 61140600 93.88000
2016-05-17 94.55 94.70 93.01 93.49 46507400 93.49000
2016-05-18 94.16 95.21 93.89 94.56 41923100 94.56000

> write.zoo(AAPL, file=”AAPL.csv”, sep=”,”)
>chartSeries(AAPL)

 

http://dataology.blogspot.tw/2015/11/r.html
http://www.bituzi.com/2014/12/Rbacktest6mins.html
http://rstudio-pubs-static.s3.amazonaws.com/1195_6ae80fc27b38421dabc4952d2c50d3c3.html
http://www.r-software.org/paper
http://ccckmit.wikidot.com/r:main
http://wenku.baidu.com/link?url=tSwlPkr8aGSTXYQNYufVQ2yVtppMuBvYF2h8oZpO9g7insefi-8fYcoxW7Cp-Y-dvhi6A0Mdib_rNXP8DlHBNnB1gaBttpAJIblt8OtqFwO###