Good morning,
I am modelling abundance using the pcount() function in the unmarked package and am receiving the error "$ operator is invalid for atomic vectors" when trying to create tables to summarize estimates, aics, etc. I have read some previous posts and have updated both insight and sjPlot using the github function. I was wondering if anyone could help.
Also welcome to any other packages/functions that would work with this model type.
mhbdata <- read.csv("http://sites.google.com/site/unmarkedinfo/home/webinars/2012-january/data/wtmatrix.csv?attredirects=0&d=1%22")
y <- apply(mhbdata[, c("c.1", "c.2", "c.3")], 1, max, na.rm = TRUE)
elev <- mhbdata[, "elev"]
forest <- mhbdata[, "forest"]
library("unmarked")
mhb.y <- mhbdata[, c("c.1", "c.2", "c.3")]
mhbdata[, "length"] <- 1 / mhbdata[, "length"]
mhb.umf <-
unmarkedFramePCount(
y = mhb.y,
siteCovs = data.frame(
elev = mhbdata[, "elev"],
forest = mhbdata[, "forest"],
length = mhbdata[, "length"]
),
obsCovs = list(duration = mhbdata[, c("dur.1", "dur.2", "dur.3")], day = mhbdata[, c("day.1", "day.2", "day.3")])
)
obsCovs(mhb.umf) <- scale(obsCovs(mhb.umf))
siteCovs(mhb.umf)$forest <- scale(siteCovs(mhb.umf)$forest)
siteCovs(mhb.umf)$elev <- scale(siteCovs(mhb.umf)$elev)
str(mhb.umf)
fm1 <- pcount( ~ 1 ~ 1, mhb.umf)
fm2 <- pcount( ~ 1 ~ elev, mhb.umf)
fm3 <- pcount( ~ 1 ~ forest, mhb.umf)
fm4 <- pcount( ~ 1 ~ length, mhb.umf)
fm5 <- pcount( ~ 1 ~ forest + elev, mhb.umf)
fm6 <- pcount( ~ 1 ~ forest + length, mhb.umf)
fm7 <- pcount( ~ 1 ~ elev + length, mhb.umf)
fm8 <- pcount( ~ 1 ~ forest + elev + length, mhb.umf)
fm9 <- pcount( ~ 1 ~ elev + I(elev ^ 2), mhb.umf)
fm10 <- pcount( ~ 1 ~ forest + elev + I(elev ^ 2) + length, mhb.umf)
Thanks in advance, Ty