Skip to content

Simulation data for rosemckeon/ploidy

License

Notifications You must be signed in to change notification settings

rosemckeon/ploidy-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DisturPloidy Simulations

Data colleceted from scripts running the {disturploidy} R package

Available here: https://github.com/rosemckeon/ploidy

Data files are RDS format and can be read into R using readRDS(). Logs, showing the message output from the model for each simulation are held in ./data/logs/ for each set of simulations respectively. Scripts used to collect the data are also included.

Loading the data

Many of the data files in this repository are created using R > 3.6.0 readRDS() will fail on these files if your R < 3.5.0

From R >= 3.5.0:

sim <- readRDS("data/quick-test-1.rds")

Larger, more meaningful datasets are stored in ./benefits and /costs.

Running these/other simulations for yourself

You'll need a few dependencies to run the scripts. Primarily the model itself, which isn't yet on CRAN but can be installed via {devtools}.

From RStudio you can simply open and run the script files, or in any R console you can use source("path-to-file.R").

You can also set simulations running on a server/unix/mac machine without entering an R console. From terminal or a BASH script do Rscript path-to-file.R. To run these in the background on linux use tmux.

When you run simulations via RScript the directory the script is in acts as the working directory for R. Bear this in mind if you make edits or move data files etc. Output will appear in ./data/, unless otherwise specified with logfilepath, see: ?disturploidy.

Data structure

Model output comes as a list. For example data/quick-test-1.rds looks like this:

List of 7
 $ call        : language disturploidy(pop_size = 250, grid_size = 10, ploidy_growth_benefit = 0.5, inbreeding_cost = 0.5,      pollen_rang| __truncated__ ...
 $ time        :List of 4
  ..$ start       : POSIXct[1:1], format: "2019-08-22 16:14:41"
  ..$ end         : POSIXct[1:1], format: "2019-08-22 16:26:21"
  ..$ duration    :Class 'difftime'  atomic [1:1] 11.7
  .. .. ..- attr(*, "units")= chr "mins"
  ..$ sim_duration:Class 'difftime'  atomic [1:1] 2.92
  .. .. ..- attr(*, "units")= chr "mins"
 $ R           : chr "R version 3.4.4 (2018-03-15)"
 $ disturploidy: chr "DisturPloidy version 0.0.0008"
 $ notes       : chr "Dataframes contain all members of a generation that will face survival over the winter and go on to begin the n"| __truncated__
 $ data        :List of 5
  ..$ seedbank   :Classes ‘tbl_df’, ‘tbl’ and 'data.frame':	0 obs. of  9 variables:
  .. ..$ ID        : Factor w/ 0 levels: 
  .. ..$ X         : num(0) 
  .. ..$ Y         : num(0) 
  .. ..$ life_stage: Factor w/ 0 levels: 
  .. ..$ size      : num(0) 
  .. ..$ ploidy    : num(0) 
  .. ..$ genome    : list()
  .. ..$ gen       : int(0) 
  .. ..$ sim       : Factor w/ 0 levels: 
  ..$ juveniles  :Classes ‘tbl_df’, ‘tbl’ and 'data.frame':	17 obs. of  11 variables:
  .. ..$ ID         : Factor w/ 17 levels "0_101","0_141",..: 3 11 8 15 4 5 7 10 14 2 ...
  .. ..$ X          : num [1:17] 6 9 6 8 7 5 2 6 3 1 ...
  .. ..$ Y          : num [1:17] 5 2 9 7 4 2 5 9 6 4 ...
  .. ..$ life_stage : Factor w/ 1 level "1": 1 1 1 1 1 1 1 1 1 1 ...
  .. ..$ size       : num [1:17] 1.11 1.15 1.25 1.18 1.27 ...
  .. ..$ ploidy     : num [1:17] 2 2 2 2 2 2 2 2 2 2 ...
  .. ..$ gen        : num [1:17] 1 1 1 1 1 1 1 1 1 1 ...
  .. ..$ sim        : Factor w/ 4 levels "1","2","3","4": 1 1 2 2 2 2 2 2 3 3 ...
  .. ..$ genome     :List of 17
  .. ..$ growth_rate: num [1:17] 1.12 1.15 1.25 1.18 1.27 ...
  .. ..$ inbreeding : logi [1:17] FALSE FALSE FALSE FALSE FALSE FALSE ...
  ..$ adults     :Classes ‘tbl_df’, ‘tbl’ and 'data.frame':	1953 obs. of  11 variables:
  .. ..$ X          : num [1:1953] 0 0 0 0 0 0 1 1 1 1 ...
  .. ..$ Y          : num [1:1953] 0 1 5 6 8 9 0 3 4 6 ...
  .. ..$ ID         : Factor w/ 1601 levels "0_10","0_100",..: 153 130 106 104 42 98 95 141 79 92 ...
  .. ..$ life_stage : Factor w/ 1 level "2": 1 1 1 1 1 1 1 1 1 1 ...
  .. ..$ size       : num [1:1953] 1.89 2.08 2.29 1.57 1.64 ...
  .. ..$ ploidy     : num [1:1953] 2 2 2 2 2 2 2 2 2 2 ...
  .. ..$ gen        : num [1:1953] 1 1 1 1 1 1 1 1 1 1 ...
  .. ..$ sim        : Factor w/ 4 levels "1","2","3","4": 1 1 1 1 1 1 1 1 1 1 ...
  .. ..$ genome     :List of 1953
  .. ..$ growth_rate: num [1:1953] 1.89 2.08 2.29 1.57 1.64 ...
  .. ..$ inbreeding : logi [1:1953] FALSE FALSE FALSE FALSE FALSE FALSE ...
  ..$ seedoutput :Classes ‘tbl_df’, ‘tbl’ and 'data.frame':	32571 obs. of  9 variables:
  .. ..$ ID        : Factor w/ 8519 levels "1_1","1_10","1_100",..: 1 790 901 1012 1123 1234 1345 1456 1567 2 ...
  .. ..$ X         : num [1:32571] 7 5 8 6 4 3 7 9 2 6 ...
  .. ..$ Y         : num [1:32571] 6 8 7 7 9 3 3 3 5 5 ...
  .. ..$ life_stage: Factor w/ 1 level "0": 1 1 1 1 1 1 1 1 1 1 ...
  .. ..$ size      : int [1:32571] 0 0 0 0 0 0 0 0 0 0 ...
  .. ..$ ploidy    : num [1:32571] 2 2 2 2 2 2 2 2 2 2 ...
  .. ..$ genome    :List of 32571
  .. ..$ gen       : int [1:32571] 1 1 1 1 1 1 1 1 1 1 ...
  .. ..$ sim       : Factor w/ 4 levels "1","2","3","4": 1 1 1 1 1 1 1 1 1 1 ...
  ..$ disturbance:Classes ‘tbl_df’, ‘tbl’ and 'data.frame':	16 obs. of  3 variables:
  .. ..$ sim     : int [1:16] 1 1 1 1 2 2 2 2 3 3 ...
  .. ..$ gen     : int [1:16] 2 3 4 5 2 3 4 5 2 3 ...
  .. ..$ occurred: logi [1:16] FALSE TRUE TRUE TRUE TRUE TRUE ...
 $ log         :List of 4
  ..$ : chr "data/logs/quick-test-1-sim-1.txt"
  ..$ : chr "data/logs/quick-test-1-sim-2.txt"
  ..$ : chr "data/logs/quick-test-1-sim-3.txt"
  ..$ : chr "data/logs/quick-test-1-sim-4.txt"

About

Simulation data for rosemckeon/ploidy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages