What the package does (one paragraph).
- Project title: ccog-content-media-report
- Inception Date: Month + Year when project started (e.g. May 2019)
- Main Stakeholder department(s): A list of interested departments (e.g. sports/childrens/etc)
- Main Stakeholder(s): A list of interested parties
- Author(s): Firstname Lastname
..Please complete..
..Please complete..
..Add any more info here if required..
See vignettes/
The R ecosystem is slightly different to that of Python and the approach to virtual environments is different. On 2019-08-02 an introduction to renv was created by the folks at RStudio. For the purposes of this template, it's recommended that we also use renv.
To learn more about how renv works see here.
To install the latest renv install the following in your system-level version of R.
Note: check that R will use the proxy if on the BBC network.
file.edit('~/.Renviron') # in Rstudio, or in any text editor of your choicethen add to the file and save / write out:
https_proxy=http://www-cache.reith.bbc.co.uk:80
http_proxy=http://www-cache.reith.bbc.co.uk:80Now you should be able to do the following:
..If anything more than R package install required, use docker..
- Install docker desktop - https://www.docker.com/products/docker-desktop
- Run
make docker- this will build and then run the container, will take a while the first time - Instructions to access via a terminal or web interface will be printed to the console Note: see thoughts / issues on the use of Docker to manage dependencies here. For more general information on R environments and Docker see here.
..Otherwise..
Option A: Using make (the easy way):
- (Optional) initialise a renv for the project and activate:
make create_environment
-
To make sure your environment is stored run
make packagebefore checking in -
There are other things you can easily run using
make:
Run make help to remind yourself:
> make help:
clean Delete all temp files (including environment)
create_environment Set up R interpreter environment
data Make Dataset
docker Run docker container, will build it first if required
docker_stop Stop the running container
make shiny Build and run shiny app
package Package dependencies to lockfile
sync_data_from_s3 Download Data from S3
sync_data_to_s3 Upload Data to S3
test Run tests inside renv
update_environment Sync Dependencies with Lockfile
Run the unit tests using make test
..If you are making use of s3 to back up data..
Data is stored here: s3://map-input-output/ccog-content-media-report
To get data:
- Set up AWS cli on your machine, download the cli from AWS and then run something like the below on an EC2 box to generate some credentials to use:
instanceid=$( \ curl -s 'http://169.254.169.254/latest/meta-data/iam/security-credentials/' ) curl "http://169.254.169.254/latest/meta-data/iam/security-credentials/${instanceid}" - Once access is granted you can run
make sync_data_from_s3to download data to use
..Include instructions on how to run your program, or get up and running with your package.
..Any more info on visualisations or where results might be saved. Under the package structure currently in use, we suggest using vignettes.