Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/15.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中使用ggplot2时在is.finite(x)中出错_R_Ggplot2 - Fatal编程技术网

在R中使用ggplot2时在is.finite(x)中出错

在R中使用ggplot2时在is.finite(x)中出错,r,ggplot2,R,Ggplot2,我尝试在R中的两个系列之间运行一个简单的F测试,使用: var.test(fit1,fit2) 但我得到了一个错误: Error in is.finite(x) : default method not implemented for type 'list' 我已尝试使用以下线程中的建议解决此问题: 通过运行: devtools::install_github('cran/ggplot2', force = TRUE) 尽管此行运行正常,但错误仍然存在。我尝试卸载ggplot2并重复该过

我尝试在R中的两个系列之间运行一个简单的F测试,使用:

var.test(fit1,fit2)
但我得到了一个错误:

Error in is.finite(x) : default method not implemented for type 'list'
我已尝试使用以下线程中的建议解决此问题:

通过运行:

devtools::install_github('cran/ggplot2', force = TRUE)
尽管此行运行正常,但错误仍然存在。我尝试卸载ggplot2并重复该过程,每次都重新启动R

我创建fit1和fit2的初始代码如下: 此模型基于从CSV文件导入的经济索引创建:

index_ma = ma(df_ind$weight_ind_2, order=7)
count_ma = ts(na.omit(index_ma), frequency=30)
decomp = stl(count_ma, s.window="periodic")
deseasonal_cnt <- seasadj(decomp)
fit1<-auto.arima(deseasonal_cnt, seasonal=FALSE)
econ_ma = ma(df_daily$sp_change, order=7)
econ_count_ma = ts(na.omit(econ_ma), frequency=30)
econ_decomp = stl(econ_count_ma, s.window="periodic")
econ_decomped <- seasadj(econ_decomp)
fit2<-auto.arima(econ_decomped, seasonal=FALSE)
index_ma=ma(df_ind$weight_ind_2,order=7)
计数=ts(不适用(索引),频率=30)
decomp=stl(count\u ma,s.window=“periodic”)

你好,欢迎来到SO!这是一个相当常见的错误信息,这就是为什么您对如何解决问题的研究导致您走上了错误的道路。我认为可以肯定地说,您的错误与
ggplot2
无关,因为这是一个绘图库。如果您向我们提供有关您的对象
fit1
fit2
的更多信息,甚至给我们您的数据快照,我们将更有可能帮助您!你好谢谢你的回答-我现在将添加更多细节,希望能有所帮助。这些是复杂的模型对象,你不能简单地对它们运行F测试。具体来说,你的目标是什么?您想评估哪种模型更适合数据吗?
var.test
仅适用于数值向量或类
lm
的线性模型。它正在尝试调用arima对象上的
is.finite
,假设它是一个数字向量。我想看看这两个序列是否非常相似。我试图为每个系列建立一个ARIMA模型,并用F检验来比较它们的方差。但我完全愿意用任何方法来比较它们,这在统计学上更合理!