Skip to contents

Create Species Response Curves

Usage

response_curves(modern_mod, species_select = NULL)

Arguments

modern_mod

An object of class BTFr from run_modern

species_select

a vector of species names for which you want to create response curves

Value

Response curve data files (empirical data and model-based estimates) and species response curve plots

Examples

# \donttest{
test_modern_mod <- run_modern(
  modern_elevation = NJ_modern_elevation,
  modern_species = NJ_modern_species,
  n.iter = 10,
  n.burnin = 1,
  n.thin = 1
)
#> Start chain ID  1 
#> module glm loaded
#> module dic loaded
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 175
#>    Unobserved stochastic nodes: 3136
#>    Total graph size: 20460
#> 
#> Initializing model
#> 
#> Hooraah, Chain 1 has finished! 
#> Start chain ID  2 
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 175
#>    Unobserved stochastic nodes: 3136
#>    Total graph size: 20460
#> 
#> Initializing model
#> 
#> Hooraah, Chain 2 has finished! 
#> Start chain ID  3 
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 175
#>    Unobserved stochastic nodes: 3136
#>    Total graph size: 20460
#> 
#> Initializing model
#> 
#> Hooraah, Chain 3 has finished! 
#> Run complete! 
response_curves(test_modern_mod)
#> $src_plot

#> 
#> $src_empirical_dat
#> # A tibble: 4,025 × 3
#>     SWLI species proportion
#>    <dbl> <chr>        <dbl>
#>  1  196. Ti+Sl      0.315  
#>  2  196. Mf         0      
#>  3  196. Tc         0.0385 
#>  4  196. Jm+Bp      0.123  
#>  5  196. Hs         0.492  
#>  6  196. Am         0.00769
#>  7  196. Ai         0      
#>  8  196. Ab         0      
#>  9  196. Mp         0.00769
#> 10  196. Pl         0.0154 
#> # … with 4,015 more rows
#> 
#> $src_model_dat
#> # A tibble: 4,025 × 5
#>     SWLI species proportion proportion_lwr proportion_upr
#>    <dbl> <chr>        <dbl>          <dbl>          <dbl>
#>  1  27.0 Ti+Sl      0.0197        0.00164          0.0655
#>  2  27.0 Mf         0.181         0.0316           0.311 
#>  3  27.0 Tc         0.0112        0.000987         0.0405
#>  4  27.0 Jm+Bp      0.0110        0.00101          0.0213
#>  5  27.0 Hs         0.00622       0.000239         0.0196
#>  6  27.0 Am         0.0237        0.0115           0.0626
#>  7  27.0 Ai         0.0311        0.000962         0.0642
#>  8  27.0 Ab         0.434         0.201            0.817 
#>  9  27.0 Mp         0.0191        0.00182          0.0557
#> 10  27.0 Pl         0.0254        0.00457          0.0495
#> # … with 4,015 more rows
#> 
# }