java 为什么 R 找不到 auto.arima 函数?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12237584/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why couldn't R find the auto.arima function?
提问by Nurul
I am new to R. I encountered an error when I wanted to use the auto.arima
function. The message was:
我是 R 新手。我想使用该auto.arima
函数时遇到错误。消息是:
could not find function "auto.arima"
找不到函数“auto.arima”
I've installed the forecast
package. I'm using R2.14.1 version and forecast 3.16 in windows 7 operating system. What can I do?
我已经安装了这个forecast
包。我在 Windows 7 操作系统中使用 R2.14.1 版本并预测 3.16。我能做什么?
If I could use the auto.arima
function in R and get the best result model, I want to call the auto.arima
method in my Java project. How would I use the R library in java project?
如果我可以auto.arima
在 R 中使用该函数并获得最佳结果模型,我想auto.arima
在我的 Java 项目中调用该方法。我将如何在 java 项目中使用 R 库?
回答by Seb
As the others pointed out: You have downloaded the package with install.packages()
or from the menu but you did not loadthe package. This is done by library(forecast)
or require(forecast)
. You can obtain single functions as well with the command: package::function()
just like: forecast::auto.arima()
. So much for a little clarification. If you need a graphical user interface (it makes life easier) check out Rstudio Rstudioor R commander install.packages(Rcmdr)
or rJava proposed by Zach.
正如其他人指出的那样:您已经install.packages()
通过菜单或从菜单下载了软件包,但没有加载该软件包。这是由library(forecast)
或完成的require(forecast)
。您也可以使用以下命令获取单个函数:package::function()
就像:forecast::auto.arima()
。这么多的一点澄清。如果您需要图形用户界面(它使生活更轻松),请查看Zach 提出的Rstudio Rstudio或 R 指挥官 install.packages(Rcmdr)
或 rJava。
回答by Zach
- As @Jeromy Anglim says:
library(forecast)
- http://www.rforge.net/rJava/
- 正如@Jeromy Anglim 所说:
library(forecast)
- http://www.rforge.net/rJava/
回答by Chuy
When installing, make sure you mark the "Install Dependencies" option.
安装时,请确保标记“安装依赖项”选项。
回答by kelvin
To use the auto.arima package, you need to install the package "quadprog". Install that package first and put forecast into library and you should be ok
要使用 auto.arima 包,您需要安装包“quadprog”。首先安装该软件包并将预测放入库中,您应该没问题
回答by rsc05
You need to do the following steps
您需要执行以下步骤
install.packages("xts")
install.packages("forecast", dependencies = TRUE)
library(forecast)
This worked for me.
这对我有用。