Organizing the unmarkedMultFrame

152 views
Skip to first unread message

Evan Hill

unread,
Jan 23, 2015, 12:44:35 PM1/23/15
to unma...@googlegroups.com
Hello everybody,

Thank you in advance for your response.  I am trying to organize my data into an unmarkedMultFrame.  
I can succesfully create the unmarkedMultFrame, but when I try to run a simple model, such as:
fm0 <- colext(~1, ~1, ~1, ~1, umf)
I get the following error message:
Error in data.frame(..., check.names = FALSE) : 
  arguments imply differing number of rows: 1695, 0

Here is some basic info about my study:
number of sites = 91
number of visits per season = 3
number of seasons = 12

In my study, I had 91 unique sites, which I visited 3 times over the course of 6 rounds during the spring of two years 2013-2014.  
I am treating each round of sampling as a separate season, so I have 12 seasons total, if I stack the data.  
In my attached .csv, each row corresponds to a site, and includes a detection history that is 3 digits long, corresponding to the 3 surveys I performed at that site during that season.
I think my problem is in the obsCovs portion of the umf data frame.  If I surveyed a site during a season, I surveyed it 3 times, so I have observation level covariates (e.g. noise level at time of survey) corresponding to each of the zeroes and ones of the detection history.    However, I examined the umf data frame in R and I think it is reading each of the three ObsCovs as a separate row (1695 rows instead of 565 rows).  

Here is a sample of my code:

library(unmarked)
smbdata <- read.csv("smbdata.csv", header=TRUE)

SORAy <- smbdata[,5:7]

siteCovs <- smbdata[,c(29:42)]

years <- smbdata[,c(2:4)]

obsCovs <- list(Obs=smbdata[,c(14:16)], Start=smbdata[,c(17:19)], 
                Sky=smbdata[,c(20:22)], Wind=smbdata[,c(23:25)], 
                Noise=smbdata[,c(26:28)])

SORA <- unmarkedMultFrame(y=SORAy,
                         siteCovs=siteCovs, yearlySiteCovs=years,
                         obsCovs=obsCovs,
                         numPrimary=12)

fm0 <- colext(~1, ~1, ~1, ~1, SORA)  

Again, thank you in advance for your response.  I'm sorry if this doesn't make a lot of sense, but I'm attempting a space-for-time analysis, but I think I really have a space-AND-time situation.  In summary, my main questions are:
1) Have formatted my umf data frame correctly, given my sampling format of 3 surveys per site per season?
2) Do I need to include rows of all NAs for the sites that were not visited at all in a given round?
3) Have I correctly identified my primary and secondary sampling periods?  My current understanding is that I have 12 primary and 3 secondary.   

smbdata.csv

Mathias Tobler

unread,
Jan 23, 2015, 4:29:22 PM1/23/15
to unma...@googlegroups.com
Evan,

check the format of  your input data. Your SORAy data frame should have a dimension of 91x36 (91 by 12*3) not 563x3. Your siteCovs should  have a dimension of 91xn, one row for each site. Same problem for your years data frame. Look at the help for unmarkedMultFrame and make sure your data is correctly formatted.

Best,

Mathias
--
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Evan Hill

unread,
Jan 23, 2015, 5:40:00 PM1/23/15
to unma...@googlegroups.com
Thank you, Mathias!  I really appreciate the help.  I will re-arrange the data and see if works.  My obsCovs should also be 91x36, to match the detection histories, correct?  Or should the obsCovs be 91xn, similar to the siteCovs?

Thanks again,

Evan H
Reply all
Reply to author
Forward
0 new messages