crawlMerge | R Documentation |
This function can be used to merge crwData
or crwHierData
objects (as returned by crawlWrap
) with additional data streams
and/or covariates that are unrelated to location.
crawlMerge(crwData, data, Time.name)
crwData |
A |
data |
A data frame containing required columns |
Time.name |
Character string indicating name of the time column to be used for merging |
Specifically, the function merges the crwData$crwPredict
data frame with data
based on the ID
, Time.name
, and, if crwData
is hierarchical, level
columns. Thus data
must contain ID
, Time.name
, and, if crwData
is hierarchical, level
columns.
Only rows of data
with ID
, Time.name
, and, if crwData
is hierarchical, level
values that exactly match crwData$crwPredict
are merged. Typically, the Time.name
column
in data
should match predicted times of locations in crwData$crwPredict
(i.e. those corresponding to crwData$crwPredict$locType=="p"
)
A crwData
object
## Not run: # extract simulated obsData from example data obsData <- miExample$obsData # error ellipse model err.model <- list(x= ~ ln.sd.x - 1, y = ~ ln.sd.y - 1, rho = ~ error.corr) # Fit crwMLE models to obsData and predict locations # at default intervals for both individuals crwOut <- crawlWrap(obsData=obsData, theta=c(4,0),fixPar=c(1,1,NA,NA), err.model=err.model,attempts=100) # create data frame with fake data stream data <- data.frame(ID=rep(factor(c(1,2)),times=c(753,652)), time=c(1:753,1:652), fake=rpois(753+652,5)) # merge fake data stream with crwOut crwOut <- crawlMerge(crwOut,data,"time") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.