Hello, I am running my nest survival data in RMark and am having some trouble when it comes to the "export.MARK" function. I am following the example in the mallard dataset, but get this error message when I try to export the data:
Error in export.MARK(modo.results$Age$data, "modoDSR", modo.results, replace = TRUE, :
$ is not a processed dataframemodo.results$Age is not a processed dataframedata is not a processed dataframe
I also tried exporting my models one at a time rather than after running them all within a function and got this message:
Error in export.MARK(modo.proc, "mo", list = c(Dot, vornest), replace = TRUE) :
unused argument (list = c(Dot, vornest))
The problem with the latter code may just be that I really don't get how to create a marklist for multiple models, even after reading the documentation a few times over (not new to R but new to RMark). I'm just going to go ahead and paste all my code since in some of the other postings I've found there's a recurring issue with not having enough info to address the problem.
Last but not least, I've been looking for examples of how to use the logistic-exposure link with nest survival data and can only find that it's possible, but not how to do it. Any help would be much appreciated and I apologize if this is a redundant question- I searched the forum but didn't find any directly relevant examples.
Code:
#Read in data
modor <- read.table(file=paste("C:/D", "modor", ".txt", sep=""), sep="\t", header=TRUE, na.strings=c("NA"))
# Make year a factor variable
modor$year <- factor(modor$year, labels=c("1","2"))
#Create function following example in RMark documentation
run.modor=function()
{
#Constant survival model
Dot=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~1)))
#DSR as function of VOR at nest
vornest=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~vornest)))
#DSR varies with nest age
age=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~Age)))
#DSR varies with distance to two-track
ttdist=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~ttdist)))
#DSR varies with distance to solar facility
sfdist=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~sfdist)))
#DSR varies with VOR at nest & grass cover
vorgrass=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~vornest+grass)))
#DSR varies with distance to solar facility and age
sfdistage=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~sfdist+Age)))
#DSR varies with distance to major road and age
mrdistage=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~mrdist+Age)))
#DSR varies with distance to two-track & forb cover
ttdistforb=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~ttdist+forb)))
#DSR varies with distance to two track, VOR at nest, & distance to major road
ttdistvornestmrdist=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~mrdist+ttdist+vornest)))
#DSR varies with nest age and year
ageyear=mark(modor,nocc=119, model="Nest", model.parameters=list(S=list(formula=~Age+year)), groups=c("year"))
#Only gives parameter estimates for 2nd year.
#DSR varies with nest age and distance to solar facility
sfdistyear=mark(modor,nocc=119, model="Nest", model.parameters=list(S=list(formula=~sfdist+year)), groups=c("year"))
#DSR varies with distance to solar facility, nest age, and year
sfdistageyear=mark(modor,nocc=119, model="Nest", model.parameters=list(S=list(formula=~sfdist+Age+year)), groups=c("year"))
#DSR varies with distance to solar facility, nest age, VOR at nest, and year
sfdistageyearvor=mark(modor,nocc=119, model="Nest", model.parameters=list(S=list(formula=~sfdist+Age+year+vornest)), groups=c("year"))
#DSR varies with the interaction between nest age and forb cover
ageforb=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~forb+Age+forb*Age)))
return(collect.models() )
}
modo.results=run.modor()
#Try exporting model results based on example in “mallard”
export.MARK(modo.results$Age$data,"modoDSR",modo.results,replace=TRUE,ind.covariates="all")
#Error message:
#Error in export.MARK(modo.results$Age$data, "modoDSR", modo.results, replace = TRUE, :
# $ is not a processed dataframemodo.results$Age is not a processed dataframedata is not a #processed dataframe
#Try to export data following example in export.MARK page
Dot=mark(modor, nocc=119, model="Nest", model.parameters=list(S=list(formula=~1))) modo.proc=process.data(modor,nocc=119,model="Nest")
vornest=mark(modor, nocc=119, model="Nest",
model.parameters=list(S=list(formula=~vornest)))
export.MARK(modo.proc,"mo",list=c(Dot,vornest), replace=TRUE)
#Error message:
#Error in export.MARK(modo.proc, "mo", list = c(Dot, vornest), replace = TRUE) :
# unused argument (list = c(Dot, vornest))