0

R just:

Error: could not find function "ets"

ets is under the forecast package right? I can't use it.

lmo
  • 37,904
  • 9
  • 56
  • 69
hxnnx
  • 73
  • 1
  • 1
  • 6
  • Welcome to StackOverflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610). This will make it much easier for others to help you. – Jaap May 14 '16 at 12:30
  • 1
    Did you run `library(forecast)` first? – tblznbits May 14 '16 at 12:33
  • i did then R: Error in ets(API, "ANN") : y should be a univariate time series – hxnnx May 14 '16 at 13:18
  • 1
    @hxnnx - That means the function was found, you just entered the wrong values. This question is solved. Please accept the answer below and ask a new question about the univariate time series if you are still having problems. – Rich Scriven May 14 '16 at 19:38

1 Answers1

2

You must import the library first:

 library(forecast)
 ?ets

If you get an error that R cannot find the package, you must install it:

 install.packages("forecast")

See the documentation

D3C34C34D
  • 415
  • 2
  • 10