Problem with NA's in y dataframe for Unmarked MultFrame?

72 views
Skip to first unread message

Kate

unread,
Mar 16, 2018, 12:08:15 PM3/16/18
to unmarked
Hi everyone, 

I have tried to find a solution to this issue to no avail. Here are some details (Note-I have attached my data and code if it helps):

Analysis
I am trying to run a dynamic occupancy model for Pronghorns using data from wildlife cameras. I have 3 years and 12 occasions for each year (36 total). There were some occasions during which cameras did not run, and I have written "NA" in such instances. Thus, for my 'y' data frame I have "NA's" dispersed throughout. I am using camera model for my obsCovs data frame and vegetation height and year for my yearlySiteCovs data frame. For the SiteCovs data frame, I have Site, Treatment Type, and Grass Cover.

Issue
When I import all of the data, I get the following error message:"Error in unmarkedMultFrame(y = ProngoccuAll, siteCovs = SiteCovs, yearlySiteCovs = yearly.site.covs,  : 
At least one matrix in yearlySiteCovs has incorrect number of dimensions." However, when I look at the "Environment" window in R ALL of the data I have imported for yearlySiteCovs (Year and VegHt) has the same number of observations (39) and variables (36) as all the other data frames, except for the siteCovs frame with has 39 observations of 3 variables (as it should).

Question
For the yearlySiteCovs data frame, do I need to include NA's that match those in the y data frame?

Thanks in advance for any help with this!

Best,
Kate Wilkins
PronghornOccu.R
Cam.csv
SiteCovs.csv
VegHt.csv
y.csv
Year.csv

Kate

unread,
Mar 16, 2018, 1:19:53 PM3/16/18
to unmarked
P.S. In my code, the PronghornOccu.csv should be y.csv.

Kate

unread,
Mar 16, 2018, 3:16:01 PM3/16/18
to unmarked
As an update, I placed "NA's" in the yearlySiteCovs data frame to match the "y" data frame and ran the code. This did not work and I'm still getting the same error message of "At least one matrix in yearlySiteCovs has incorrect number of dimensions". Any help with why I'm receiving this error message would be much appreciated! Please see data and code attached to first message.

Best,
Kate

John Clare

unread,
Mar 16, 2018, 4:57:51 PM3/16/18
to unmarked
Hi Kate,

The dimensions of yearlySiteCovs should be nsite (36) rows and numPrimary (3) columns.

John

Kate

unread,
Mar 16, 2018, 5:22:35 PM3/16/18
to unmarked
Hi John, 

Thank you so much for that clarification! I knew it would be something simple.

Best,
Kate
Reply all
Reply to author
Forward
0 new messages