NCEAS / arcticdatautils

Utility functions in R for processing data for the Arctic Data Center
https://nceas.github.io/arcticdatautils/
Apache License 2.0
10 stars 20 forks source link

raster helper function edits: attributeList #199

Open dvirlar2 opened 1 year ago

dvirlar2 commented 1 year ago

Changed the usage of an attributes data frame to a listed attributeList within the function, and edited the documentation to reflect those changes.

From what I've seen, most PIs input the raster layer in the web editor, so converting the single attributeList to a data frame feels like an odd side-step. If a raster is missing an attributeList, I think the better way forward would be to create an attList either through the webform or Shiny. If done through Shiny, then running set_attributes() and adding it back to the otherEntity before converting to a spatialRaster, rather than reverting an attList to a data frame.

dvirlar2 commented 1 year ago

raster helper function edits: coord_name argument

Added a warning message if the coord_name argument is NULL. Warning message alerts users that EML won't validate, and provides correct string for commonly used WGS84 and NAD83 datums. Also directs users to the get_coord_list() for more information.

dvirlar2 commented 1 year ago

No longer a draft 👍🏽

dvirlar2 commented 1 year ago

I haven't ran any formal tests within the package's test folder, but I was running tests between each push to make sure things were working and error-ing in the right/expected places. I can add a test to the end of the test_eml.R file, I'll just need a quick overview of how that works. I'll read through the testing chapter in the R Packages manual later today

jeanetteclark commented 1 year ago

Yeah formalizing what you did ad-hoc as a test, in addition to running the rest of the tests (via devtools::test()) would be good. I should have written a test when I added this function initally