We provide here the R-code for reproducing Schaub et al (20xxa).
The code is structured into
- 'seed_price_master.R': the master R script
- 'seed_price_des_analysis.R': runs the descriptive analysis, including the Upset approach
- 'seed_price_lin_model.R': runs the linear analysis of the relationship between seed prices and plant diversity
In order to run the analysis you need to
- create a project folder and within this main folder you need to create a sub-folder called 'r_code', in which you save all provided r scripts.
- specify your main working directory (i.e., 'wd_code') in the R script 'seed_price_master.R'.
- Now you can run the R script 'seed_price_master.R', which downloads the data automatically and reproduces our analysis.
The data of the paper can be found under Schaub et al. (2021b) (https://doi.org/10.3929/ethz-b-000485215)
References:
Schaub, S., et al. 20xxa. The costs of diversity: higher prices for more diverse grassland seed mixtures
Schaub, S., et al. 20xxb. Data: German and Swiss seed mixture prices and characteristics. ETH Research Collection. https://doi.org/10.3929/ethz-b-000485215