Learn R Programming

x12 (version 1.10.3)

loadP: loadP and saveP

Description

Functions loadP and saveP load and save parameter settings.

Usage

# S4 method for x12Single
loadP(object, file)
# S4 method for x12Batch
loadP(object, file)
# S4 method for x12Parameter
loadP(object, file)
# S4 method for x12Single
saveP(object, file)
# S4 method for x12Batch
saveP(object, file)
# S4 method for x12Parameter
saveP(object, file)

Arguments

file

filepath

Methods

signature(object = "x12Batch")

signature(object = "x12Parameter")

signature(object = "x12Single")

See Also

x12, x12Batch

Examples

Run this code
# NOT RUN {
#Create new batch object with 4 time series and change some parameters
xb <- new("x12Batch",list(AirPassengers,AirPassengers,AirPassengers,AirPassengers))
xb <- setP(xb,list(automdl=FALSE))
xb <- setP(xb,list(arima.model=c(1,1,0),arima.model=c(1,1,0)),1)
xb <- setP(xb,list(arima.model=c(0,1,1),arima.smodel=c(0,1,1)),2)
xb <- setP(xb,list(arima.model=c(0,1,1),arima.smodel=c(1,1,1)),3)
xb <- setP(xb,list(arima.model=c(1,1,1),arima.smodel=c(1,1,1)),4)

#save all parameters
saveP(xb,file="xyz.RData")
xb1 <- new("x12Batch",list(AirPassengers,AirPassengers,AirPassengers,AirPassengers))

#load all parameters and save it to the corresponding series inside a x12Batch-object
xb1 <- loadP(xb1,file="xyz.RData")


xs <- new("x12Single",ts=AirPassengers)
xs <- setP(xs,list(arima.model=c(2,1,1),arima.smodel=c(2,1,1)))
#Save the parameters
saveP(xs,file="xyz1.RData")

#Load a saved parameter set to a x12Single object
xs <- new("x12Single",ts=AirPassengers)
xs <- loadP(xs,file="xyz1.RData")

#Replace all parameters in a x12Batch object with one parameter set
xb <- new("x12Batch",list(AirPassengers,AirPassengers,AirPassengers,AirPassengers))
xb <- loadP(xb,file="xyz1.RData")
# }

Run the code above in your browser using DataLab