[问题类型]:
程式咨询(我想用R 做某件事情,但是我不知道要怎么用R 写出来)
[软件熟悉度]:
新手(没写过程式,R 是我的第一次)
[问题叙述]:
x<-read.table("s.txt",header=T,row.names=c("time"))
head(x)
adjprc.10000 adjprc.10001
2000-01-31 -4.37500 -2.04167
2000-02-29 -3.25000 -2.08333
2000-03-31 -4.43750 -2.10417
2000-04-30 -4.00000 -2.12500
2000-05-31 -3.10938 -2.10417
2000-06-30 -3.09375 -2.04167
这是我的资料形式,在跑程式时遇到一些问题,大概R是无法判断我的时间格式,
不知道怎么转换成R读得懂的格式,上网找了几天资讯还是解决不了。
我是R新手,还请大家教我一下,谢谢。
structure(list(adjprc.10000 = c(-4.375, -3.25, -4.4375, -4, -3.10938,
-3.09375, -2.84375, -1.09375, -1.03125, -0.78125, -0.82813, -0.51563,
-0.40625, -0.40625, -0.25, -0.23438, -0.21875, 0, NA, NA, NA,
NA, NA, NA), adjprc.10001 = c(-2.04167, -2.08333, -2.10417, -2.125,
-2.10417, -2.04167, -2.02083, -2.16667, 2.125, 2.20833, 2.33333,
2.33333, 2.25, 2.08333, 2.125, -2.04167, -1.89583, 1.95833, 2,
2.16667, 2.08333, 2.125, 2.0625, 1.95833)), .Names = c("adjprc.10000",
"adjprc.10001"), class = "data.frame", row.names = c("2000-01-31",
"2000-02-29", "2000-03-31", "2000-04-30", "2000-05-31", "2000-06-30",
"2000-07-31", "2000-08-31", "2000-09-30", "2000-10-31", "2000-11-30",
"2000-12-31", "2001-01-31", "2001-02-28", "2001-03-31", "2001-04-30",
"2001-05-31", "2001-06-30", "2001-07-31", "2001-08-31", "2001-09-30",
"2001-10-31", "2001-11-30", "2001-12-31"))