R执行报错:Error in `[<-.ts`(`*tmp*`,...only replacement of elements is allowed
原因:
pred$mean是Time-Series类型,rbind函数不支持。通过as.double将其转换成double类型即可。
修改前代码:
all_predata_time <- data.frame(pd=0.1,Row=1,preRow=0,pt=0.1,stasid='1',InitDate='1');
all_predata_time <- all_predata_time[-1,] stasPowerPre_Time <- function(staid){
testSrc<-......
if(nrow(testSrc)>0)
{
maxDate <- max(testSrc$bizdate)
tsd<- ts(testSrc$dp,start=c(2016,01,01),frequency=365)
str(tsd)
x <- ets(tsd)
pred <- forecast(x,h=365) predata <- data.frame(pd = pred$mean)
predata$Row <-as.integer(row.names(predata));
predata$preRow <- predata$Row -1;
predata$pt <- as.double(c(0));
predata$stasid <- staid;
predata$InitDate <- maxDate ;
all_predata_time <<- rbind(all_predata_time,predata)
}
}
修改后代码:
all_predata_time <- data.frame(pd=0.1,Row=1,preRow=0,pt=0.1,stasid='1',InitDate='1');
all_predata_time <- all_predata_time[-1,] stasPowerPre_Time <- function(staid){
testSrc<-......
if(nrow(testSrc)>0)
{
maxDate <- max(testSrc$bizdate)
tsd<- ts(testSrc$dp,start=c(2016,01,01),frequency=365)
str(tsd)
x <- ets(tsd)
pred <- forecast(x,h=365) predata <- data.frame(pd = as.double(pred$mean))
predata$Row <-as.integer(row.names(predata));
predata$preRow <- predata$Row -1;
predata$pt <- as.double(c(0));
predata$stasid <- staid;
predata$InitDate <- maxDate ;
all_predata_time <<- rbind(all_predata_time,predata)
}
}
参考:https://blog.csdn.net/wlt9037/article/details/74389807


R执行报错:Error in `[<-.ts`(`*tmp*`,...only replacement of elements is allowed的更多相关文章
- 【mysql】 load local data infield 报错 ERROR 1148 (42000): The used command is not allowed with this MySQL version
mysql> load data local infile '/Users/flint/learn/mysql/pet' into table bx_pet; 执行报错 ERROR 1148 ( ...
- php源码安装执行configure报错error: off_t undefined; check your library configuration
php安装执行configure报错error: off_t undefined; check your library configuration vim /etc/ld.so.conf 添加如下几 ...
- linux使用wkhtmltopdf报错error while loading shared libraries:
官网提示 linux需要这些动态库.depends on: zlib, fontconfig, freetype, X11 libs (libX11, libXext, libXrender) 在li ...
- 发布报错:Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store
发布报错:Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store 昨晚上传项目到AppStore,报了这个错,纳尼! ...
- mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法
1. 问题背景 InnoDB是新版MySQL(v5.5及以后)默认的存储引擎,之前版本的默认引擎为MyISAM,因此,低于5.5版本的mysql配置文件.my.cnf中,关于InnoD ...
- 运行yum报错Error: Cannot retrieve metalink for reposit
http://www.netpc.com.cn/593.html 运行yum报错Error: Cannot retrieve metalink for reposit 今天给Centos通过rpm - ...
- 转:运行yum报错Error: Cannot retrieve metalink for reposit
http://www.netpc.com.cn/593.html 运行yum报错Error: Cannot retrieve metalink for repository: epel. Please ...
- 在使用 Git pull 时候报错 error: inflate
在使用 Git pull 时候报错 error: inflate 具体的错误是 这样的 error: inflate: data stream error (unknown compression m ...
- go报错unimplemented: 64-bit mode not compiled in与mingw 64位安装报错ERROR res已解决
问题一:cc1.exe: sorry, unimplemented: 64-bit mode not compiled in 参考:https://www.cnblogs.com/lesroad/p/ ...
随机推荐
- js 中的console.log有什么作用
主要是方便你调式javascript用的.你可以看到你在页面中输出的内容. 相比alert他的优点是: 他能看到结构话的东西,如果是alert,淡出一个对象就是[object object],但是co ...
- Spring 配置数据源之一三兄弟
前期的准备工作,我们是使用的是maven,我们下载节点即可... 节点如下: <dependency> <groupId>org.springframework</gro ...
- [清华集训]Rmq Problem / mex
题目链接 我们离线处理这些询问 在右端点所在的位置用vector来push_back询问 维护每个数值最后出现的位置p[x] 从左往右扫,边走边回答询问 对于每个询问我们回答第一个p[x]<l的 ...
- PHP CURL库学习
基本请求步骤 : // . 初始化 $ch = curl_init(); // . 设置选项,包括URL curl_setopt($ch, CURLOPT_URL, "http://www. ...
- 使用 Leaflet 显示 ArcGIS 生成西安80坐标的地图缓存
Leaflet 是一个非常小巧灵活的 Geo js 库,esri 本身也在 Github 上有 leaflet 的相关项目.但是 leaflet 本身支持 Web Mercator Auxiliary ...
- idea appliction context not configured for this file
File --> Project Structure
- CSS 颜色 字体 背景 文本 边框 列表 display属性
1 颜色属性 <div style="color:blueviolet">ppppp</div> <div style="color:#f ...
- Week5——Ajax
1.简介 AJAX 相当于异步 JavaScript 和 XML,是一种用于创建快速动态网页的技术.通过在后台与服务器进行少量数据交换,AJAX 可以使网页实现异步更新.这意味着可以在不重新加载整个网 ...
- UpdateServer事务实现机制
UpdateServer(UPS) 是OceanBase的写入单点,一个集群中只有一台UPS服务器,所有的写都写入到这台机器.OceanBase采用基于静动态数据分离的机制,静态数据存储在静态数据服务 ...
- [翻译] SIAlertView
SIAlertView https://github.com/Sumi-Interactive/SIAlertView An UIAlertView replacement with block sy ...