Skip to content

Commit

Permalink
visual inspection of data
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasHohmann committed Nov 17, 2023
1 parent 0e4527e commit 43b43e6
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 1 deletion.
4 changes: 3 additions & 1 deletion REPRODUCEME.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ From here, you can continue to inspect the generated data or generate the plots

## 2. Inspection of provided data

All produced data is in the folder _/data/_. For a detailed description of the data structure and contents see the file _/data/R_outputs/codebook.md_ (for outputs from R) and _/data/matlab_outputs/codebook.md_ (for outputs from matlab)
All produced data is in the folder _/data/_. For a detailed description of the data structure and contents see the file _/data/R_outputs/codebook.md_ (for outputs from R) and _/data/matlab_outputs/codebook.md_ (for outputs from matlab).

R outputs can be visualized using the scripts in _code/visualize_data.R_.

## 3. Reproduction of figures

Expand Down
73 changes: 73 additions & 0 deletions code/visualize_data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
## Visualize Data ##

#### Load packages ####
require(paleoTS)

#### Load R outputs ####
load("data/R_outputs/results_modes_of_evolution.Rdata")
load("data/R_outputs/ageDepthModelsScenariosAandB.Rdata")
load("data/R_outputs/parameters_for_tests.Rdata")

#### Age-Depth Models ####
scenario = "A"
dist = "1 km"

stopifnot(scenario %in% scenarioNames)
stopifnot( dist %in% all_dist )
plot(x = ageDepthModels[[scenario]][[dist]]$time,
y = ageDepthModels[[scenario]][[dist]]$height,
xlab = "Time [Myr]",
ylab = "Height [m]",
main = paste0("Age-Depth Model, ", dist, " from shore, scenario ", scenario, sep = ""),
type = "l")

#### Simulated lineages sampled in strat. domain ####
scenario = "A"
dist = "2 km"
evo_mode = "Brownian motion"
run_no = 10

stopifnot(scenario %in% scenarioNames)
stopifnot(dist %in% examinedBasinPositions)
stopifnot(evo_mode %in% simulatedEvoModes)
stopifnot(run_no <= noOfTests)

## plot strat expression of trait evolution
plot(x = testResultsStrat[[scenario]][[dist]][[evo_mode]][[run_no]]$inputData$height,
y = testResultsStrat[[scenario]][[dist]][[evo_mode]][[run_no]]$inputData$traitValue,
type = "l",
xlab = "Height [m]",
ylab = "Trait Value",
main = paste(evo_mode, "scenario", scenario, dist, "offshore ; run no. ", run_no))

## plot time expression of trait evolution
plot(x = testResultsStrat[[scenario]][[dist]][[evo_mode]][[run_no]]$inputData$time,
y = testResultsStrat[[scenario]][[dist]][[evo_mode]][[run_no]]$inputData$traitValue,
type = "l",
xlab = "Time [Myr]",
ylab = "Trait Value",
main = paste(evo_mode, "scenario", scenario, dist, "offshore ; run no. ", run_no))

## plot paleoTS object derived from trait evolution in the section
plot(testResultsStrat[[scenario]][[dist]][[evo_mode]][[run_no]]$paleots)

#### Simulated lineages sampled only in the time domain ####
scenario = "A"
no_of_loc = "100"
evo_mode = "Brownian motion"
run_no = 100

stopifnot(scenario %in% scenarioNames)
stopifnot(dist %in% noOfSamplingLoc)
stopifnot(evo_mode %in% simulatedEvoModes)
stopifnot(run_no <= noOfTests)

## Trait simulations
plot(x = testResultsTime[[scenario]][[no_of_loc]][[evo_mode]][[run_no]]$inputData$time,
y = testResultsTime[[scenario]][[no_of_loc]][[evo_mode]][[run_no]]$inputData$traitValue,
xlab = "Time [Myr]",
ylab = "Trait Value",
main = paste0(evo_mode, "scenario", scenario, no_of_loc, "sampling locations, run no. ", run_no),
type = "l")
## paleoTS objects
plot(testResultsTime[[scenario]][[no_of_loc]][[evo_mode]][[run_no]]$paleots)

0 comments on commit 43b43e6

Please sign in to comment.