Skip to content

extract values from summary

2 messages · Felipe Carrillo, Dieter Menne

#
Hi:
 # How can I extract the 'Forecasts' from the 'summary(predicted)' from the example below?

library(forecast)
weightData <- data.frame(weight = c(2.1,2.4,2.8,3.6,4.1,5.2,6.3),week= 1:7)
weight <- as.numeric(weightData$weight)
predicted <- forecast(weight,h=3,level=95)  # see the predicted
summary(predicted)

# I would like to extract the three predicted values and
# make a line plot with the 'Point Forecast' values only.
 # I tried str(predicted) and names(predicted) to see which
 # variable had the forecast values but I crashed. Thanks


Felipe D. Carrillo  
Supervisory Fishery Biologist  
Department of the Interior  
US Fish & Wildlife Service  
California, USA
#
Felipe Carrillo <mazatlanmexico <at> yahoo.com> writes:
example below?

..
Let's hope R crashed, not you. But anyway, a crash after str() means that
something is seriously wrong with you installation and requires reporting
to the author, including details of sessionInfo().

However, it looks like that's already well known: 

See 

http://cran.at.r-project.org/web/checks/check_results_forecasting.html

where the package is rather reddish.

Dieter