Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R性能分析不起作用_R_Xts - Fatal编程技术网

R性能分析不起作用

R性能分析不起作用,r,xts,R,Xts,我想对我的数据使用R性能分析。我从数据库中获取数据,结果如下: PnL<-GetDRWPnLByDesk("Entity A") # this gets the data from the database head(PnL) 下面是我的两个专栏的类 类别(PnL$businessdate) [1] POSIXct“POSIXt” 现在我想使用charts.PerformanceSummary()函数,因此我创建了一个时间序列对象并尝试使用它: PnL_TS <- xts(PnL

我想对我的数据使用R性能分析。我从数据库中获取数据,结果如下:

PnL<-GetDRWPnLByDesk("Entity A") # this gets the data from the database
head(PnL)
下面是我的两个专栏的类

类别(PnL$businessdate) [1] POSIXct“POSIXt”

现在我想使用charts.PerformanceSummary()函数,因此我创建了一个时间序列对象并尝试使用它:

 PnL_TS <- xts(PnL$PnL, order.by=as.Date(PnL$businessdate, format="%Y%m%d"))
charts.PerformanceSummary(PnL_TS)

PnL\u TS这可能是因为你的向量
PnL\u TS
<代码>图表。性能摘要(x)
x:资产返回的xts、向量、矩阵、数据帧、时间序列或动物园对象

PnL_TS <- ROC(PnL_TS) # convert to log returns
charts.PerformanceSummary(PnL_TS) # plot

PnL\TS为什么这个标签是SAS?我删除了SAS标签是一个错误。
 PnL_TS <- xts(PnL$PnL, order.by=as.Date(PnL$businessdate, format="%Y%m%d"))
charts.PerformanceSummary(PnL_TS)
PnL_TS <- ROC(PnL_TS) # convert to log returns
charts.PerformanceSummary(PnL_TS) # plot