noaa-onms / onmsR

R package of common functions for dataset wrangling and plotting used across National Marine Sanctuaries, originally for interactive infographic products per Sanctuary
https://noaa-onms.github.io/onmsR
MIT License
0 stars 0 forks source link

add rocky_* data internally to R package #7

Closed bbest closed 2 years ago

bbest commented 2 years ago

Previously MARINe shared raw data files that got summarized by me for various interactive infographic Sanctuary websites. New data then became problematic with differences between sanctuary infographic websites.

The new strategy is to fold all of these data across sanctuaries into datasets native to this R package.

bbest commented 2 years ago

See: old cinms/rocky.R · noaa-onms/cinms

bbest commented 2 years ago

I checked in a big commit that's almost there with a new strategy to have sanctuary polygons and rocky intertidal MARINe data loaded internally to the onmsR package since we're the only ones who update that from the raw data and the file sizes are manageable:

These were generated by rocky.R and sanctuaries.R in the data-raw/ folder and with usethis::use_data() get saved into the data/ folder as zipped Rdata (*.rda) objects for lazily loading with the package, per Chapter 14 External data | R Packages.

I need to do rocky_count data next and then update the plotting functions.

bbest commented 2 years ago

The idea is that whenever new data is ready to ingest from MARINe, they share the raw percent cover and counts CSV files with us. We then run this script onmsR:data-raw/rocky.R which should do a bit more QA/QC like ensuring column names exist with proper data types. Then it processes all the data and saves the necessary data objects as tibbles and spatial feature objects listed as rocky_* in Function reference • onmsR.

I hope to finish by Friday with the seastar counts raw data, which introduces new rocky_sites, and the funciton updates which will take advantage of these natively available data objects, so not rely on some external sites_csv or similar found who knows where.