24小时热门版块排行榜    

CyRhmU.jpeg
南方科技大学公共卫生及应急管理学院2025级博士研究生招生报考通知
查看: 791  |  回复: 1

DQQ004

金虫 (小有名气)

[求助] R语言就帮助~~~已有1人参与

R中库函数
chart.Style(R.fund, R.style, method = c("constrained", "unconstrained", "normalized" )  ,   leverage   =    FALSE, main = NULL, ylim = NULL, unstacked=TRUE, ...)

R.fund matrix, data frame, or zoo object with fund returns to be analyzed  
R.style matrix, data frame, or zoo object with style index returns. Data object must be of the same length and time-aligned with R.fund  

我从txt文件中导入数据序列
data1<-read.table(".\\*.txt",header=F)
data2<-read.table(".\\.txt",header=F)
data1=as.ts(data1)
data2=as.ts(as.matrix(data2))
chart.Style(data1,data2, method="constrained", leverage=FALSE, unstack=TRUE, las=3)
运行时出错,提示如下:
      错误于switch(method, vector = { :
     The data cannot be converted into a time series.  If you are trying to pass in names from a data object with one column, you should use the form 'data[rows, columns, drop = FALSE]'.  Rownames should have standard date formats, such as '1985-03-15'.
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

alorsmail

铁杆木虫 (著名写手)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
DQQ004: 金币+10, 有帮助 2014-06-18 08:25:50
你的数据格式有问题,
需要转换为标准格式,比如 '1985-03-15'
或者在 option 里面说明格式
2楼2014-06-17 01:12:12
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 DQQ004 的主题更新
信息提示
请填处理意见