weecology / portalr

A collection of functions to summarize the Portal Data
https://weecology.github.io/portalr/
Other
11 stars 12 forks source link

1977 Longterm data reporting too many plots #308

Open ethanwhite opened 2 weeks ago

ethanwhite commented 2 weeks ago
abundance_data <- portalr::summarize_rodent_data(path = ".", 
                                                 clean = FALSE, 
                                                 level = "Treatment", 
                                                 plots = "Longterm", 
                                                 type= "Rodents", 
                                                 unknown = FALSE, 
                                                 shape = "crosstab", 
                                                 time = "all", 
                                                 na_drop = FALSE, 
                                                 zero_drop = FALSE, 
                                                 min_traps=1, 
                                                 effort = TRUE, 
                                                 min_plots = 1, 
                                                 download_if_missing = TRUE, 
                                                 quiet=FALSE)  
head(abundance_data, 5)
# A tibble: 5 × 27
  newmoonnumber censusdate period treatment ntraps nplots    BA    DM    DO    DS  `NA`    OL    OT    PB    PE    PF    PH    PI    PL    PM    PP    RF    RM    RO    SF    SH    SO
          <int> <date>      <dbl> <chr>      <int>  <dbl> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int>
1             1 1977-07-16      1 control      539     11     0    21     0     3     3     0     1     0     1     1     0     0     0     0     1     0     0     0     0     0     0
2             2 1977-08-19      2 control      539     11     0    30     0     7     1     0     0     0     0     2     0     0     0     0     1     0     0     0     0     0     0
3             3 1977-09-11      3 control      539     11     0    21     0    13     2     0     0     0     0     2     0     0     0     0     1     0     0     0     0     0     0
4             4 1977-10-16      4 control      196      4     0    11     2     7     2     1     2     0     0     0     0     0     0     0     0     0     0     0     0     0     0
5             4 1977-10-16      4 exclosure    196      4     0     8     2     0     0     0     0     0     0     0     0     0     0     0     0     0     1     0     0     0     0
gmyenni commented 6 days ago

This is because the longterm plots are defined as 3, 4, 10, 11, 14, 15, 16, 17, 19, 21, 23, but all the plots are assigned treatment 'control' for the first 3 months, until the treatments were done. I'm going to add a column in the treatment table labeling them 'longterm' so that is better established. But it won't change anything that's happening here. We'll have to change the treatment assignments. We could call the first 3 months "burnin" instead of control. Or we could leave the controls as-is, and just call everything else "burnin" or something. If we don't want to change the treatment assignment, I'd have to just do something within the filter_plots function to handle this special case.