library(knitr)
opts_chunk$set(tidy.opts=list(width.cutoff=80),tidy=TRUE)
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

Introduction

This vignette is designed to demonstrate the basic workings of the batwintor package using the built in data. This data has been collected from published literature, our own field studies (provide SERDP language here) and in collaboration with the Laursen lab at the university of British Columbia.

Data

The data products included in this packages area bat.params, and fung.params. They contain all of the information that you will need in order to run the model. To access this data simply type:

# library(devtools)
# install_github("cReedHranac/batwintor") #install from GitHub
library(batwintor)
data("bat.params") ; data("fung.params")

The structure and details of these data items are available though ?. In summary, bat.params contains 22 parameters for 12 species and fung.params includes parameters for two different growth equations. Throughout this vignette we will be modeling the bat species Myotis lucifugus (coded as MYLU) and using the Chaturvedi fungal parameters.

mylu.params <- batLoad(bat.params, "MYLU")
fung.ch <- fungalSelect("Chaturvedi")

Model

Once you've selected the data you want to you it's time to set up the environmental space to run the model across. Note: This step can be a major determinate in how long it the calculations will take.

env <- buildEnv(temp = c(0,20), #temperatures in degrees C
                pct.rh = c(75, 100), #precent humidity
                range.res.temp = 2, #resolution of the temperature
                range.res.rh = 2, #resolution of the humidithy
                twinter = 3, #maximal length of winter (in this case I have months)
                winter.res = 7) #resolution of the time vector in days

Now that the environmental parameters are set, we can run the actual model by simply calling hibernationModel.

mylu.mod <- hibernationModel(env = env, bat.params = mylu.params, fung.params = fung.ch)

The object returned by this modeling call will be a data.table with columns representing results for both infected, and uninfected animals (denoted by n. in their column name). Many of the column names should look familar, Ta and pct.rh for instance are the parameters used to define the environmental space in buildEnv and the time column is the twinter vector created. The other columns in the datatable are values calculated for both infected and uninfected bats. Columns with the prefix of n. represent the null or uninfected values while columns without the prefix represent the infected animals. If you'd like to learn more about the product output please call ?hibernationModel. Have fun and happy modeling!



cReedHranac/batwintor documentation built on Jan. 27, 2020, 7:39 p.m.