Hi All,
Thanks in advance for any and all help.
I have 22 sites. My primary sampling periods are made up of 29 year x season combinations, 2011-2018 with 4 seasons each year except 2018 which only has 1 season. Within each primary sampling period I have 3 replicate animal counts.
I have created a UMF using unmarkedFramePCO() but am concerned that the structure of my 3 data frames (y, siteCovs and yearlySiteCovs) must be wrong as when I ask for a summary of my UMF i get the below, suggesting an incorrect number of secondary sampling periods and an incorrect number of max and mean observations per site.
unmarkedFrame Object
22 sites
Maximum number of observations per site: 1
Mean number of observations per site: 1
Number of primary survey periods: 29
Number of secondary survey periods: 0.03448276
Error in FUN(newX[, i], ...) :
(list) object cannot be coerced to type 'double'
I have been at this for a couple of days now and thought i was getting somewhere...... any advice on where I have gone wrong and how my data frames should be restructured would be very much appreciated.
Please find attached my 3 data frames and below my code.
Pat
#load data
y <- read.csv("count_dat_wide_format.csv", header = TRUE)
head(y)
siteCovs <- read.csv("siteCovs.csv", header = TRUE)
head(siteCovs)
yearlySiteCovs <- read.csv("yearlySiteCovs2.csv", header = TRUE)
head(yearlySiteCovs)
#define y, siteCovs and yearlySiteCovs for creating UMF
y <- matrix(y[1:22,])
siteCovs <- siteCovs[1:22,]
year <- yearlySiteCovs[1:22, 1:29]
season <- yearlySiteCovs[1:22, 30:58]
distance <- yearlySiteCovs[1:22, 59:87]
yearlySiteCovs <- list(year = year, season = season, distance = distance)
#create UMF
umf <- unmarkedFramePCO(y = y, siteCovs = siteCovs, yearlySiteCovs = yearlySiteCovs, numPrimary = 29)
#take a look at UMF
summary(umf)