Last updated: 2022-12-28

Checks: 6 1

Knit directory: freezing_cycles/

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.


The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

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(20220415) 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 ed0e131. 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:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/site_libs/

Untracked files:
    Untracked:  data/tree.nwk
    Untracked:  output/M_vs_plong_plot.pdf
    Untracked:  output/tree_Cycles.pdf

Unstaged changes:
    Deleted:    .DS_Store
    Modified:   analysis/0.data.Rmd
    Modified:   analysis/1.freezing_cycles_tolerance.Rmd
    Modified:   analysis/2.long_freezing_vs_cycles.Rmd
    Modified:   analysis/3.freezing_vs_environment.Rmd
    Modified:   code/model.txt
    Deleted:    data/.DS_Store
    Modified:   data/data_freezing.xlsx
    Deleted:    data/tree.nex
    Modified:   freezing_tardigrades.Rproj
    Deleted:    output/M_vs_plong_plot.svg
    Modified:   output/means_cycles.txt
    Modified:   output/mod.env.rds
    Modified:   output/model_fit.env.pdf
    Deleted:    output/tree_Cycles.svg

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.


There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.


library(tidyverse)
library(dplyr)
library(readxl)  # To read from excel files
library(xfun)    # Download file from html report

This document describes the data analysis and plotting

Freezing experimental data

The original data file is data_freezing.xlsx and can be downloaded from here:

Download data_freezing.xlsx

.

The excel spreadsheet contains 3 sheets:

  • They are:
    • data_cycles: Experimental data on repeated daily freezing cycles survival. The columns are:
      • ID: the individual tardigrades ID.
      • 0 to 7: each freezing-thaw cycle (1 = alive / 0 = dead).
      • species_code: species code.
      • unfrozen: if in any of the freezing cycles the water in the well didn´t froze when placed at -7C.
      • when: for unfrozen = 1, at which cycle the water didn´t freeze.
    • species_data: Data on the species/populations used in the experiments, including environmental data from their sampling sites. The columns are:
      • species_code: species code.
      • Lat and Lon: origin coordinates of the used populations.
      • Origin: origin of the used populations.
    • species_abbrev: Species abbreviations used in the other sheets. The columns are:
      • species_code: species code.
      • species: species name.

Phylogenetic tree

A phylogenetic tree of the used species has been obtained with IQtree with the concatenated alignment of the markers 18S, 28S and COI.
The tree can be downloaded here:

Download tree.nwk

sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.utf8 
[2] LC_CTYPE=English_United Kingdom.utf8   
[3] LC_MONETARY=English_United Kingdom.utf8
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.utf8    

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

other attached packages:
 [1] xfun_0.34       readxl_1.4.1    forcats_0.5.2   stringr_1.4.1  
 [5] dplyr_1.0.10    purrr_0.3.5     readr_2.1.3     tidyr_1.2.1    
 [9] tibble_3.1.8    ggplot2_3.4.0   tidyverse_1.3.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9          lubridate_1.9.0     assertthat_0.2.1   
 [4] rprojroot_2.0.3     digest_0.6.30       utf8_1.2.2         
 [7] mime_0.12           R6_2.5.1            cellranger_1.1.0   
[10] backports_1.4.1     reprex_2.0.2        evaluate_0.18      
[13] httr_1.4.4          pillar_1.8.1        rlang_1.0.6        
[16] googlesheets4_1.0.1 rstudioapi_0.14     jquerylib_0.1.4    
[19] rmarkdown_2.18      googledrive_2.0.0   munsell_0.5.0      
[22] broom_1.0.1         compiler_4.2.1      httpuv_1.6.6       
[25] modelr_0.1.10       pkgconfig_2.0.3     htmltools_0.5.3    
[28] tidyselect_1.2.0    workflowr_1.7.0     fansi_1.0.3        
[31] crayon_1.5.2        withr_2.5.0         tzdb_0.3.0         
[34] dbplyr_2.2.1        later_1.3.0         grid_4.2.1         
[37] jsonlite_1.8.3      gtable_0.3.1        lifecycle_1.0.3    
[40] DBI_1.1.3           git2r_0.30.1        magrittr_2.0.3     
[43] scales_1.2.1        cli_3.4.1           stringi_1.7.8      
[46] cachem_1.0.6        fs_1.5.2            promises_1.2.0.1   
[49] xml2_1.3.3          bslib_0.4.1         ellipsis_0.3.2     
[52] generics_0.1.3      vctrs_0.5.0         tools_4.2.1        
[55] glue_1.6.2          hms_1.1.2           fastmap_1.1.0      
[58] yaml_2.3.6          timechange_0.1.1    colorspace_2.0-3   
[61] gargle_1.2.1        rvest_1.0.3         knitr_1.41         
[64] haven_2.5.1         sass_0.4.2