View source: R/Module_Sub_boots_functions.R
reformatBootData | R Documentation |
Reformat bootstrapped input data to match normal format
reformatBootData(boot.output, prepData.ouput)
boot.output |
A list of lists. Ouput of |
prepData.ouput |
A list. Output of |
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
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.