reformatBootData: Reformat bootstrapped input data to match normal format

Description Usage Arguments Value Examples

View source: R/Module_Sub_boots_functions.R

Description

Reformat bootstrapped input data to match normal format

Usage

1
reformatBootData(boot.output, prepData.ouput)

Arguments

boot.output

A list of lists. Ouput of bootSeries can be converted to a list to be compatible.

prepData.ouput

A list. Output of prepData.

Value

A list with length equal to number of bootstrap samples (equaling the column count in each matrix in boot.output). Each subelement is a list and maintains the structure of prepData.output.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
data.use <- read.csv("SampleFile_WithAge.csv")  # read in raw data
dat.prepped <-  prepData(datafile = data.use,out.labels="v2")
boot.n <- 1000
boot.output <- lapply(dat.prepped$data, function(x){
#name of age column varies, so use index:
	series.use <- x[,3]
createBoots(series = series.use, boot.type = "meboot", boot.n = boot.n , plot.diagnostics = FALSE )
createBoots(series = series.use, boot.type = "stlboot", boot.n = 1000 , plot.diagnostics = FALSE )
})
bootdata.reformat <- reformatBootData(boot.output, prepData.ouput = dat.prepped)
length(bootdata.reformat)
str(bootdata.reformat[[1]])

## End(Not run)

MichaelFolkes/forecastR_package documentation built on April 4, 2021, 5:14 a.m.