Last updated: 2023-04-14

Checks: 7 0

Knit directory: veg_alcontar/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20211007) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 97c5d1c. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    data/.DS_Store

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/temporal_analysis_fire_epoch.Rmd) and HTML (docs/temporal_analysis_fire_epoch.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 97c5d1c ajpelu 2023-04-14 change a la limón
html 5591608 ajpelu 2023-04-13 Build site.
Rmd aab8ee0 ajpelu 2023-04-13 add analysis congreso pastos 2023

1 Introduction

  • Read data
veg_raw <- readxl::read_excel(here::here("data/datos_sep2023_todos_juntos.xlsx")) |> 
  janitor::clean_names() 

autumn_fire <- lubridate::ymd("2018-12-18")
spring_fire <- lubridate::ymd("2019-05-07")

veg <- veg_raw |> 
  filter(zona != "Quemado sin pastoreo") |> 
  rename(fecha = fecha_muestreos) |> 
  mutate(treat = as.factor(case_when(
    zona == "Quemado con pastoreo" ~ "Ot", 
    TRUE ~ "Pr"
  ))) |> 
  mutate(meses = ifelse(treat == "Ot",
                        as.numeric(as.character(lubridate::interval(autumn_fire, lubridate::ymd(fecha)) %/% months(1))),
                        as.numeric(as.character(lubridate::interval(spring_fire, lubridate::ymd(fecha)) %/% months(1))))) |> 
  mutate(quadrat = as.factor(quadrat)) |> 
  mutate(meses = case_when(
    meses == 0 ~ -1, 
    TRUE ~ meses
  ))

veg_total <- veg |> filter(tipo == "total")
veg_mt <- veg |> filter(tipo == "Macrochloa tenacissima") 
veg_gs <- veg |> filter(tipo == "Genista scorpius") 

# Subset of data (pre/post) 
ad_total <- veg_total |> filter(meses %in% c(-1, 22, 24)) 
ad_mt <-  veg_mt |> filter(meses %in% c(-1, 22, 24)) 
ad_gs <- veg_gs |> filter(meses %in% c(-1, 22, 24))

2 All sps

2.1 Total Cover

2.1.1 Model

f <- as.formula(cob_total ~ s(meses, k=5, bs="cs") + treat)

m <- gamm(f, 
          random = list(quadrat = ~1), 
          data = veg_total, 
          family = nb)

 Maximum number of PQL iterations:  20 
# Distribution of Model Family

Predicted Distribution of Residuals

 Distribution Probability
       normal         47%
      tweedie         34%
       cauchy          9%

Predicted Distribution of Response

               Distribution Probability
 neg. binomial (zero-infl.)         62%
              beta-binomial         25%
                exponential          3%

2.1.2 Model validation

Version Author Date
5591608 ajpelu 2023-04-13

2.1.3 Coefficients

A. parametric coefficients Estimate Std. Error t-value p-value
(Intercept) 3.1363 0.1006 31.1906 < 0.0001
treatPr -0.1774 0.1436 -1.2356 0.2175
B. smooth terms edf Ref.df F-value p-value
s(meses) 3.9313 4.0000 96.0674 < 0.0001

2.1.4 Visualizing effects

Version Author Date
5591608 ajpelu 2023-04-13

Version Author Date
5591608 ajpelu 2023-04-13

2.1.5 Pre-post (autumn)

Version Author Date
5591608 ajpelu 2023-04-13
term df sumsq meansq statistic p.value
meses 1 29238.49 29238.49 42.98 0.0000
treat 1 0.44 0.44 0.00 0.9797
meses:treat 1 555.63 555.63 0.82 0.3679
Residuals 124 84364.31 680.36

2.2 Phytovol

2.2.1 Model

f <- as.formula(fitovol ~ s(meses, k=5, bs="cs") + treat)
m <- gamm(f,
          random = list(quadrat = ~1), 
          data = veg_total, 
          family = tw)

 Maximum number of PQL iterations:  20 
# Distribution of Model Family

Predicted Distribution of Residuals

 Distribution Probability
       cauchy         41%
      tweedie         31%
       normal         25%

Predicted Distribution of Response

 Distribution Probability
    lognormal         72%
      tweedie         12%
            F          9%

2.2.2 Model validation

Version Author Date
5591608 ajpelu 2023-04-13

2.2.3 Coefficients

A. parametric coefficients Estimate Std. Error t-value p-value
(Intercept) 6.0647 0.1952 31.0758 < 0.0001
treatPr -0.2432 0.2774 -0.8767 0.3813
B. smooth terms edf Ref.df F-value p-value
s(meses) 3.9171 4.0000 231.9889 < 0.0001

2.2.4 Visualizing effects

Version Author Date
5591608 ajpelu 2023-04-13

Version Author Date
5591608 ajpelu 2023-04-13

2.2.5 Pre-post (autumn)

Version Author Date
5591608 ajpelu 2023-04-13
term df sumsq meansq statistic p.value
meses 1 239540101 239540101 43.29 0.0000
treat 1 3904958 3904958 0.71 0.4025
meses:treat 1 867093 867093 0.16 0.6929
Residuals 124 686064856 5532781

3 Macrochloa tenacissima

3.1 Total Cover

3.1.1 Model

f <- as.formula(cob_total ~ s(meses, k=5, bs="cs") + treat)

m <- gamm(f, 
          random = list(quadrat = ~1), 
          data = veg_mt, 
          family = tw)

 Maximum number of PQL iterations:  20 
# Distribution of Model Family

Predicted Distribution of Residuals

 Distribution Probability
       normal         53%
      tweedie         28%
       cauchy          9%

Predicted Distribution of Response

               Distribution Probability
                    tweedie         34%
                      gamma         19%
 neg. binomial (zero-infl.)         16%

3.1.2 Model validation

Version Author Date
5591608 ajpelu 2023-04-13

3.1.3 Coefficients

A. parametric coefficients Estimate Std. Error t-value p-value
(Intercept) 2.2188 0.4782 4.6397 < 0.0001
treatPr 0.2735 0.6524 0.4192 0.6759
B. smooth terms edf Ref.df F-value p-value
s(meses) 3.6961 4.0000 33.0268 < 0.0001

3.1.4 Visualizing effects

Version Author Date
5591608 ajpelu 2023-04-13

Version Author Date
5591608 ajpelu 2023-04-13

3.1.5 Pre-post (autumn)

Version Author Date
5591608 ajpelu 2023-04-13
term df sumsq meansq statistic p.value
meses 1 9102.97 9102.97 8.12 0.0068
treat 1 344.67 344.67 0.31 0.5822
meses:treat 1 908.20 908.20 0.81 0.3733
Residuals 41 45950.50 1120.74

3.2 Phytovol

3.2.1 Model

f <- as.formula(fitovol ~ s(meses, k=5, bs="cs") + treat)
m <- gamm(f,
          random = list(quadrat = ~1), 
          data = veg_mt, 
          family = tw)

 Maximum number of PQL iterations:  20 
# Distribution of Model Family

Predicted Distribution of Residuals

 Distribution Probability
       normal         50%
      tweedie         25%
       cauchy         12%

Predicted Distribution of Response

 Distribution Probability
    lognormal         59%
      tweedie         12%
            F          9%

3.2.2 Model validation

Version Author Date
5591608 ajpelu 2023-04-13

3.2.3 Coefficients

A. parametric coefficients Estimate Std. Error t-value p-value
(Intercept) 5.7937 0.5415 10.6995 < 0.0001
treatPr 0.3420 0.7379 0.4635 0.6439
B. smooth terms edf Ref.df F-value p-value
s(meses) 3.7978 4.0000 75.5143 < 0.0001

3.2.4 Visualizing effects

Version Author Date
5591608 ajpelu 2023-04-13

Version Author Date
5591608 ajpelu 2023-04-13

3.2.5 Pre-post (autumn)

Version Author Date
5591608 ajpelu 2023-04-13
term df sumsq meansq statistic p.value
meses 1 137417699 137417699 17.86 0.0001
treat 1 9546071 9546071 1.24 0.2719
meses:treat 1 1792256 1792256 0.23 0.6320
Residuals 41 315547113 7696271

4 Genista scorpius

4.1 Total Cover

4.1.1 Model

f <- as.formula(cob_total ~ s(meses, k=5, bs="cs") + treat)

m <- gamm(f, 
          random = list(quadrat = ~1), 
          data = veg_gs, 
          family = tw)

 Maximum number of PQL iterations:  20 
# Distribution of Model Family

Predicted Distribution of Residuals

 Distribution Probability
       normal         38%
      tweedie         34%
       cauchy         28%

Predicted Distribution of Response

 Distribution Probability
      tweedie         41%
  half-cauchy         25%
    lognormal         12%

4.1.2 Model validation

Version Author Date
5591608 ajpelu 2023-04-13

4.1.3 Coefficients

A. parametric coefficients Estimate Std. Error t-value p-value
(Intercept) 1.7469 0.2615 6.6809 < 0.0001
treatPr -0.4106 0.3856 -1.0649 0.2890
B. smooth terms edf Ref.df F-value p-value
s(meses) 3.8165 4.0000 64.7466 < 0.0001

4.1.4 Visualizing effects

Version Author Date
5591608 ajpelu 2023-04-13

Version Author Date
5591608 ajpelu 2023-04-13

4.1.5 Pre-post (autumn)

Version Author Date
5591608 ajpelu 2023-04-13
term df sumsq meansq statistic p.value
meses 1 18954.52 18954.52 46.15 0.0000
treat 1 419.05 419.05 1.02 0.3181
meses:treat 1 335.16 335.16 0.82 0.3714
Residuals 43 17662.40 410.75

4.2 Phytovol

4.2.1 Model

f <- as.formula(fitovol ~ s(meses, k=5, bs="cs") + treat)
m <- gamm(f,
          random = list(quadrat = ~1), 
          data = veg_gs, 
          family = tw)

 Maximum number of PQL iterations:  20 
# Distribution of Model Family

Predicted Distribution of Residuals

 Distribution Probability
       cauchy         34%
      tweedie         34%
       normal         31%

Predicted Distribution of Response

 Distribution Probability
    lognormal         59%
      tweedie         12%
            F          9%

4.2.2 Model validation

Version Author Date
5591608 ajpelu 2023-04-13

4.2.3 Coefficients

A. parametric coefficients Estimate Std. Error t-value p-value
(Intercept) 5.1540 0.2480 20.7843 < 0.0001
treatPr -0.4222 0.3586 -1.1774 0.2413
B. smooth terms edf Ref.df F-value p-value
s(meses) 3.7404 4.0000 72.7425 < 0.0001

4.2.4 Visualizing effects

Version Author Date
5591608 ajpelu 2023-04-13

Version Author Date
5591608 ajpelu 2023-04-13

4.2.5 Pre-post (autumn)

Version Author Date
5591608 ajpelu 2023-04-13
term df sumsq meansq statistic p.value
meses 1 119276185.2 119276185.2 59.21 0.0000
treat 1 155552.4 155552.4 0.08 0.7824
meses:treat 1 641482.1 641482.1 0.32 0.5755
Residuals 43 86619094.1 2014397.5

5 Summary

  • Parametric terms
Tipo Variable term Estimate SE F p
All species Total cover treatOt 3.136 0.101 31.19 < 0.0001
All species Total cover treatPr -0.177 0.144 -1.24 0.2175
All species Fitovol treatOt 6.065 0.195 31.08 < 0.0001
All species Fitovol treatPr -0.243 0.277 -0.88 0.3813
Macrochloa tenacissima Total cover treatOt 2.219 0.478 4.64 < 0.0001
Macrochloa tenacissima Total cover treatPr 0.273 0.652 0.42 0.6759
Macrochloa tenacissima Fitovol treatOt 5.794 0.541 10.70 < 0.0001
Macrochloa tenacissima Fitovol treatPr 0.342 0.738 0.46 0.6439
Genista scorpius Total cover treatOt 1.747 0.261 6.68 < 0.0001
Genista scorpius Total cover treatPr -0.411 0.386 -1.06 0.289
Genista scorpius Fitovol treatOt 5.154 0.248 20.78 < 0.0001
Genista scorpius Fitovol treatPr -0.422 0.359 -1.18 0.2413
  • Smooth terms
tipo Variable term edf ref.df F p
All species Total cover s(meses) 3.931 4 96.07 < 0.0001
All species Fitovol s(meses) 3.917 4 231.99 < 0.0001
Macrochloa tenacissima Total cover s(meses) 3.696 4 33.03 < 0.0001
Macrochloa tenacissima Fitovol s(meses) 3.798 4 75.51 < 0.0001
Genista scorpius Total cover s(meses) 3.817 4 64.75 < 0.0001
Genista scorpius Fitovol s(meses) 3.740 4 72.74 < 0.0001

6 All plots

Version Author Date
5591608 ajpelu 2023-04-13

7 Summary table

Table 7.1: All species
Characteristic Ot Pr
-1, N = 321 5, N = 321 12, N = 321 17, N = 321 22, N = 321 29, N = 321 -1, N = 321 7, N = 321 12, N = 321 18, N = 321 24, N = 321
cob_total 59.22 ± 5.42 16.22 ± 2.26 16.78 ± 2.41 28.06 ± 3.24 25.97 ± 3.25 32.00 ± 3.54 54.94 ± 5.68 8.47 ± 2.00 21.94 ± 2.58 18.41 ± 2.79 27.50 ± 3.58
fitovol 3,415.15 ± 502.49 261.85 ± 57.16 331.35 ± 76.23 600.53 ± 152.12 612.47 ± 135.99 793.42 ± 204.37 3,600.32 ± 600.10 196.49 ± 63.90 351.24 ± 80.13 438.44 ± 116.67 897.76 ± 245.94
1 Mean ± std.error
Table 7.2: Macrochloa tenacissima
Characteristic Ot Pr
-1, N = 111 5, N = 91 12, N = 101 17, N = 101 22, N = 101 29, N = 101 -1, N = 121 7, N = 101 12, N = 111 18, N = 131 24, N = 121
cob_total 62.37 ± 12.17 8.28 ± 3.09 13.50 ± 3.68 21.60 ± 7.50 24.93 ± 7.93 27.72 ± 8.75 59.17 ± 10.81 17.93 ± 4.59 26.28 ± 5.77 25.25 ± 6.11 37.34 ± 8.06
fitovol 4,811.34 ± 991.38 238.56 ± 125.84 468.60 ± 181.18 921.65 ± 414.61 979.45 ± 347.58 1,389.46 ± 557.97 5,347.08 ± 1,112.59 492.69 ± 139.59 733.13 ± 164.78 904.74 ± 229.29 2,020.42 ± 501.25
1 Mean ± std.error
Table 7.3: Genista scorpius
Characteristic Ot Pr
-1, N = 101 5, N = 111 12, N = 111 17, N = 131 22, N = 141 29, N = 141 -1, N = 111 7, N = 121 12, N = 121 18, N = 111 24, N = 121
cob_total 53.20 ± 9.21 2.75 ± 0.76 5.93 ± 1.65 11.36 ± 3.83 8.79 ± 3.04 13.26 ± 4.16 41.27 ± 8.54 1.95 ± 1.30 1.73 ± 0.57 2.63 ± 0.78 4.24 ± 1.54
fitovol 3,560.00 ± 650.98 19.41 ± 6.53 190.33 ± 61.81 263.38 ± 119.28 240.46 ± 107.63 332.91 ± 174.09 3,184.45 ± 648.48 36.51 ± 33.09 13.77 ± 5.74 32.35 ± 12.24 67.89 ± 29.23
1 Mean ± std.error

R version 4.2.1 (2022-06-23)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.3.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] emmeans_1.8.1-1    plotrix_3.8-2      gtsummary_1.7.0    patchwork_1.1.2   
 [5] performance_0.10.3 broom_1.0.1        tidymv_3.3.2       kableExtra_1.3.4  
 [9] itsadug_2.4.1      plotfunctions_1.4  gratia_0.8.1       mgcv_1.8-42       
[13] nlme_3.1-157       janitor_2.1.0      here_1.0.1         forcats_0.5.2     
[17] stringr_1.4.1      dplyr_1.1.1        purrr_1.0.1        readr_2.1.3       
[21] tidyr_1.2.1        tibble_3.2.1       ggplot2_3.4.2      tidyverse_1.3.2   
[25] workflowr_1.7.0   

loaded via a namespace (and not attached):
  [1] readxl_1.4.2            backports_1.4.1         systemfonts_1.0.4      
  [4] plyr_1.8.7              splines_4.2.1           digest_0.6.31          
  [7] htmltools_0.5.4         lmerTest_3.1-3          fansi_1.0.4            
 [10] magrittr_2.0.3          paletteer_1.5.0         googlesheets4_1.0.1    
 [13] tzdb_0.3.0              modelr_0.1.9            svglite_2.1.0          
 [16] timechange_0.2.0        colorspace_2.0-3        ggrepel_0.9.3          
 [19] rvest_1.0.3             haven_2.5.1             xfun_0.35              
 [22] prismatic_1.1.1         callr_3.7.3             crayon_1.5.2           
 [25] jsonlite_1.8.4          lme4_1.1-30             zeallot_0.1.0          
 [28] glue_1.6.2              gtable_0.3.1            gargle_1.2.1           
 [31] MatrixModels_0.5-1      webshot_0.5.4           statsExpressions_1.5.0 
 [34] car_3.1-0               abind_1.4-5             scales_1.2.1           
 [37] mvtnorm_1.1-3           DBI_1.1.3               rstatix_0.7.0          
 [40] Rcpp_1.0.10             viridisLite_0.4.1       xtable_1.8-4           
 [43] tweedie_2.3.5           datawizard_0.7.1        httr_1.4.4             
 [46] RColorBrewer_1.1-3      ellipsis_0.3.2          pkgconfig_2.0.3        
 [49] farver_2.1.1            sass_0.4.5              dbplyr_2.2.1           
 [52] utf8_1.2.3              effectsize_0.8.3        reshape2_1.4.4         
 [55] tidyselect_1.2.0        labeling_0.4.2          rlang_1.1.0            
 [58] later_1.3.0             munsell_0.5.0           cellranger_1.1.0       
 [61] tools_4.2.1             cachem_1.0.6            cli_3.6.1              
 [64] generics_0.1.3          evaluate_0.18           fastmap_1.1.0          
 [67] yaml_2.3.7              rematch2_2.1.2          processx_3.8.0         
 [70] knitr_1.41              fs_1.6.1                randomForest_4.7-1.1   
 [73] pbapply_1.6-0           whisker_0.4.1           mvnfast_0.2.8          
 [76] xml2_1.3.3              correlation_0.8.4       compiler_4.2.1         
 [79] rstudioapi_0.14         ggsignif_0.6.3          gt_0.9.0               
 [82] reprex_2.0.2            broom.helpers_1.13.0    afex_1.2-0             
 [85] bslib_0.4.2             stringi_1.7.8           highr_0.9              
 [88] ps_1.7.4                parameters_0.20.3       lattice_0.20-45        
 [91] Matrix_1.5-1            commonmark_1.8.1        markdown_1.5           
 [94] nloptr_2.0.3            vctrs_0.6.1             pillar_1.9.0           
 [97] lifecycle_1.0.3         jquerylib_0.1.4         estimability_1.4.1     
[100] insight_0.19.1          httpuv_1.6.8            R6_2.5.1               
[103] bookdown_0.30           promises_1.2.0.1        BayesFactor_0.9.12-4.4 
[106] boot_1.3-28             MASS_7.3-58.3           assertthat_0.2.1       
[109] rprojroot_2.0.3         withr_2.5.0             parallel_4.2.1         
[112] bayestestR_0.13.0       hms_1.1.2               grid_4.2.1             
[115] coda_0.19-4             minqa_1.2.4             rmarkdown_2.18         
[118] snakecase_0.11.0        carData_3.0-5           googledrive_2.0.0      
[121] git2r_0.30.1            ggpubr_0.4.0            getPass_0.2-2          
[124] numDeriv_2016.8-1.1     lubridate_1.9.2         ggstatsplot_0.11.0.9000