R性能分析不起作用
我想对我的数据使用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
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