This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This example code is to understand the usage of abline function. | |
library(TSA) | |
data(rwalk) | |
model1 = lm(rwalk ~ time(rwalk)) | |
win.graph(width=4.875,height=2.5,pointsize=8) | |
plot(rwalk,type="o",ylab="y") | |
abline(model1) # add the fitted least square line from model1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#炼金术士成长之路(T1): http://www.dataanalysis.cn/alchemist/alchemist.html | |
QQ <- read.csv("http://www.dataanalysis.cn/doc/a/1/qq.csv") | |
#Solution for 1th question | |
A1 <- table(QQ$id) | |
A2 <- sort(A1,decreasing = T) | |
A2[1:10] | |
# 7cha18 6cha4376 4cha3875 8cha083 4cha698 1cha65314 | |
# 1511 1238 1100 695 533 440 |