Hi,
I am new to unmarked and R, so I am having some difficulties getting started. Any help would be greatly appreciated.
What I would like to do is use the csvToUMF() function to get my data, which is in LONG format, into an unmarkedFrame. However, when I create the unmarked frame with csvToUMF(), all of my covariates are placed at the observation level. Is there a way to specify site-level covariates using the csvToUMF() function?
Below is the code I ran with a subset of my data. The whole data set is much larger and includes many NAs. I would like AREA and Route to be site-level covariates, and Time, Temp, Wind and Cloud to be observation-level covariates.
> bacs=read.csv("bacsTEST.csv")
> head(bacs)
PointName Date TotalBACS AREA Route Time Temp Wind Cloud
1 J1 55 1 5 1 734 56 1 0
2 J1 56 0 5 1 602 52 0 0
3 J1 57 0 5 1 606 62 0 85
4 J12 55 0 5 0 1045 74 1 1
5 J12 56 0 5 0 703 55 0 0
6 J12 57 0 5 0 652 65 0 85
> test.umf <- csvToUMF(filename="bacsTEST.csv", long = TRUE, type = "unmarkedFramePCount")
> summary(test.umf)
unmarkedFrame Object
5 sites
Maximum number of observations per site: 3
Mean number of observations per site: 3
Sites with at least one detection: 3
Tabulation of y observations:
0 1 <NA>
11 4 0
Observation-level covariates: ### All my covariates are at the observation level. I want AREA and Route at the site level###
AREA Route Time Temp
Min. :2.0 Min. :0.0 Min. : 602.0 Min. :52.00
1st Qu.:2.0 1st Qu.:0.0 1st Qu.: 704.0 1st Qu.:56.50
Median :5.0 Median :1.0 Median : 734.0 Median :65.00
Mean :3.8 Mean :0.6 Mean : 794.5 Mean :64.07
3rd Qu.:5.0 3rd Qu.:1.0 3rd Qu.: 932.5 3rd Qu.:69.00
Max. :5.0 Max. :1.0 Max. :1056.0 Max. :80.00
Wind Cloud JulianDate
Min. : 0.0 Min. : 0.00 Min. :55
1st Qu.: 0.0 1st Qu.: 0.00 1st Qu.:55
Median : 0.0 Median : 1.00 Median :56
Mean : 1.2 Mean :34.47 Mean :56
3rd Qu.: 0.5 3rd Qu.:80.00 3rd Qu.:57
Max. :12.0 Max. :90.00 Max. :57