# \donttest{
d <- "https://github.com/jimclarkatduke/mast/blob/master/liriodendronExample.rData?raw=True"
repmis::source_data(d)
inputs <- list( specNames = specNames, seedNames = seedNames,
treeData = treeData, seedData = seedData,
xytree = xytree, xytrap = xytrap)
# interpolate census, add years for AR(p) model
inputs <- mastFillCensus(inputs, p = 3)
treeData <- inputs$treeData #now includes additional years
# include minimum spring temperature of previous year
cfile <- tempfile(fileext = '.csv')
d <- "https://github.com/jimclarkatduke/mast/blob/master/tmin.csv?raw=True"
download.file(d, destfile=cfile)
tyears <- treeData$year - 1
tplots <- treeData$plot
tmp <- mastClimate( file = cfile, plots = tplots,
years = tyears, months = 1:4, FUN = 'min')
treeData$tminSprAnomaly <- tmp$x[,3]
inputs$treeData <- treeData
formulaRep <- as.formula( ~ diam )
formulaFec <- as.formula( ~ diam + tminSprAnomaly )
inputs$yearEffect <- list(groups ='species', p = 3) # AR(3) model, species are lag groups
output <- mastif(inputs = inputs, formulaFec, formulaRep, ng = 1000, burnin = 400)
# }
Run the code above in your browser using DataLab