cat("\014")
參考來源:
http://stackoverflow.com/questions/14260340/function-to-clear-the-console-in-r
cat("\014")
> s1<-1:10 > s1 [1] 1 2 3 4 5 6 7 8 9 10 >
> seq(1,10,0.5) [1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 [14] 7.5 8.0 8.5 9.0 9.5 10.0 >
> s3<-c(1,3,5) > s3 [1] 1 3 5
s3<-rep(1,10) > s3 [1] 1 1 1 1 1 1 1 1 1 1
> s3<-rep("G",10) > s3 [1] "G" "G" "G" "G" "G" "G" "G" "G" "G" "G" >
sequence(c(3,5)) [1] 1 2 3 1 2 3 4 5 >
x<-rnorm(30,0,1) > x [1] -2.2447060 1.0549524 -1.7044151 1.1469852 0.8830696 0.2083887 [7] 0.8823955 -0.3976464 -0.5160780 -0.2907971 0.5140308 -0.6649935 [13] -0.5326976 2.1889057 -0.7649715 -1.6466003 0.6508996 1.9326675 [19] -1.0017353 -1.6557282 -1.3326705 1.1465761 -0.5932746 -0.3203247 [25] -1.0050817 0.1538962 -0.6863622 -0.4410272 1.6623734 0.4446147
> dnorm(0) [1] 0.3989423 > dnorm(1) [1] 0.2419707 > dnorm(2) [1] 0.05399097 > dnorm(3) [1] 0.004431848 > dnorm(4) [1] 0.0001338302 > dnorm(5) [1] 1.48672e-06
curve(dnorm,-6,6)
> x<--6:6 > pnorm(x) [1] 9.865876e-10 2.866516e-07 3.167124e-05 1.349898e-03 2.275013e-02 [6] 1.586553e-01 5.000000e-01 8.413447e-01 9.772499e-01 9.986501e-01 [11] 9.999683e-01 9.999997e-01 1.000000e+00
curve(pnorm,-6,6)
> pnorm(0) [1] 0.5 > qnorm(0.5) [1] 0
install.packages("quantmod")
library("quantmod")
tw2330 = getSymbols("2330.TW", auto.assign=FALSE)
chartSeries(tw2330, theme=chartTheme("white"))