A Getting started
The Air-Health SWS R targets pipeline requires R >= 4.0.0 and access to CARDAT’s Environment_General data storage folder on Cloudstor.
To run the Air Health SWS for the first time:
- Download and unzip or clone the air-health-sws-r-targets repository from the
Code
dropdown button. - Load the R project. Open the
_targets.R
script.- Edit the global variables
years
andstates
to set the study coverage - note with the initial parameters in the pipeline,years
is limited to 2010-2015. - Set the
download_data
boolean anddir_cardat
to the correct path (parent directory of Environment_General).
- Edit the global variables
- Open the
main..R
script. (This is not integral to the targets pipeline but is a place to keep all the useful commands for visualisiing, running and exploring the pipeline outside of the pipeline itself.) Begin running the script line-by-line from the top.renv
should automatically install and activate. Install the packages usingrenv::restore()
or try the alternative custom installation functioninstall_pkgs()
(installs the latest version if library not already available). This step may take some time.- If you have set
download_data <- FALSE
in_targets.R
, uncomment and run the lines at the top of the Run pipeline section to authenticate yourcloudstoR
package’s access to Cloudstor. You should not need to authenticate again unless your credentials have changed. - Continue on to visualise and run the pipeline.
- See the results of the desired target with
tar_read(target_name)
.
_targets.R
and the custom functions called by targets (stored in R/
) can be modified and extended to control pipeline output.