CORD-19 Data Package

R package development and documentation-writing

Published

March 18, 2020

Notable topics: R package development and documentation-writing

Recorded on: 2020-03-18

Timestamps by: Alex Cookson

View code

Screencast

Timestamps

Overview of JSON files with the data David will make a package of

Starting to create a new package with "New Project" in RStudio

Creating a file to reference the license for the dataset

use_data_raw
usethis

Using use_data_raw function from usethis package to set up a folder structure and preliminary function for raw data

Explanation that we want to limit the number of packages we load when building a package (e.g., no library(tidyverse) )

use_package
usethis

Using use_package function from usethis package to add "Suggested packages"

Reviewing import and cleaning code already completed

Using roxygen2 package to write documentation

More documentation writing

use_data
usethis

Using use_data function from usethis package to create a folder structure and datafile for (finished/cleaned) data

Making a mistake clicking "Install and Restart" button on the "Build" tab (because of huge objects in the environment) (see 26:50 for alternative)

load_all
devtools

Using load_all function from devtrools package as an alternative to "Install and Restart" from above step

document
devtools

Using document function from devtools package to process written documentation

De-duplicating paper data in a way the keeps records that have fewer missing values than other records for the same paper

use_data
usethis

Using use_data function with its overwrite argument to overwrite existing data

Writing documentation for paragraphs data

Testing an install of the package

Adding link to code in documentation

Writing examples of how to use the package (in documentation)

Discussion of outstanding items that David hasn't done yet (e.g., readme, vignettes, tests)

use_readme_rmd
usethis

Creating a simple readme, including examples, with use_readme_rmd function from usethis package

knit
knitr

Using knit function from the knitr package to knit the readme into a markdown file

Creating a GitHub repository to host the package (includes how to commit to a GitHub repo using RStudio's GUI)

Explanation that version 0.0.0.9000 means that the package is in early development

Actually creating the GitHub repository

Overview of remaining tasks