Use Package

Package Development

For reference, see:

setup

Setup the skeleton of needed files in an existing directory:

functions

Muliple functions can live in a single *.R script inside the R/ folder:

  • read.R:

  • analyze.R:

    • ship_limits(): Get breakdown of distance and time above/below speed limit

    • ship_segments(): Create line segments with speed for specific ship from AIS data

  • viz.R:

    • map_ship_limits(): Interactive map of ship limits

    • map_ship_segments(): Interactive map of ship segments

    • ship_gauge(): Show gauge of ship performance

    • ship_box(): Show value box of ship performance

documentation

Generate the R documentation from roxygen2 comments above the R functions to be placed into the manual folder /man:

data

Use raw data:

Move data files into data-raw/, then sbais.R to generate sbais.csv and load into data/ with:

usethis::use_data(sbais, overwrite = TRUE)

vignettes

packages

Create dependencies on packages so these get installed if missing. Updates the DESCRIPTION file:

website

Build website into docs/ folder with pkgdown, to be hosted using Github Pages.

Structure reference listing with inst/_pkgdown.yml per:

✔ Setting URL field in DESCRIPTION to 'https://github.com/mvisalli/shipr'
✔ Setting BugReports field in DESCRIPTION to 'https://github.com/mvisalli/shipr/issues'
✔ Writing 'NEWS.md'