reformatBootData: Reformat bootstrapped input data to match normal format

View source: R/Module_Sub_boots_functions.R

reformatBootDataR Documentation

Reformat bootstrapped input data to match normal format

Description

Reformat bootstrapped input data to match normal format

Usage

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

## 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)

SalmonForecastR/ForecastR-Package documentation built on March 10, 2023, 2:18 p.m.