# importing the orginal X-13 example file
import.spc(file.path(path.package("seasonal"), "tests", "Testairline.spc"))
# a spc with multiple user defined regression and transformation series
tdir <- tempdir()
seas(x = AirPassengers, xreg = cbind(a = genhol(cny, start = 1, end = 4,
center = "calendar"), b = genhol(cny, start = -3, end = 0,
center = "calendar")), xtrans = cbind(sqrt(AirPassengers), AirPassengers^3),
transform.function = "log", transform.type = "temporary",
regression.aictest = "td", regression.usertype = "holiday", dir = tdir,
out = TRUE)
ii <- import.spc(file.path(tdir, "iofile.spc"))
ii # list with 4 calls (3 series import, 1 main call)
# evaluating the imported calls in R
ee <- lapply(ii, eval, envir = globalenv())
ee$call # the 'seas' object produced from the .spc file
Run the code above in your browser using DataLab