简体   繁体   English

为什么 R 找不到 auto.arima 函数?

[英]Why couldn't R find the auto.arima function?

I am new to R. I encountered an error when I wanted to use the auto.arima function.我是 R auto.arima 。当我想使用auto.arima函数时遇到错误。 The message was:消息是:

could not find function "auto.arima"找不到函数“auto.arima”

I've installed the forecast package.我已经安装了forecast包。 I'm using R2.14.1 version and forecast 3.16 in windows 7 operating system.我在 Windows 7 操作系统中使用 R2.14.1 版本并预测 3.16。 What can I do?我能做什么?

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.如果我可以在 R 中使用auto.arima函数并获得最佳结果模型,我想在我的 Java 项目中调用auto.arima方法。 How would I use the R library in java project?我将如何在 java 项目中使用 R 库?

As the others pointed out: You have downloaded the package with install.packages() or from the menu but you did not load the package.正如其他人指出的那样:您已经使用install.packages()或从菜单下载了该软件包,但您没有加载该软件包。 This is done by library(forecast) or require(forecast) .这是由library(forecast)require(forecast) You can obtain single functions as well with the command: package::function() just like: forecast::auto.arima() .您也可以使用以下命令获取单个函数: package::function()就像: forecast::auto.arima() So much for a little clarification.这么多的一点澄清。 If you need a graphical user interface (it makes life easier) check out Rstudio Rstudio or R commander install.packages(Rcmdr) or rJava proposed by Zach.如果您需要图形用户界面(它使生活更轻松),请查看 Rstudio Rstudio或 R install.packages(Rcmdr)或 Zach 提出的 rJava。

  1. As @Jeromy Anglim says: library(forecast)正如@Jeromy Anglim 所说: library(forecast)
  2. http://www.rforge.net/rJava/ http://www.rforge.net/rJava/

安装时,请确保标记“安装依赖项”选项。

To use the auto.arima package, you need to install the package "quadprog".要使用 auto.arima 包,您需要安装包“quadprog”。 Install that package first and put forecast into library and you should be ok首先安装该软件包并将预测放入库中,您应该没问题

You need to do the following steps您需要执行以下步骤

install.packages("xts")
install.packages("forecast", dependencies = TRUE)
library(forecast)

This worked for me.这对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM