From 25e836a1257938437ca8ed770241594dd1d08585 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 21 Feb 2025 16:52:32 -0700 Subject: [PATCH 1/7] add contributing.md file --- CONTRIBUTING.md | 130 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..591e99f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,130 @@ +--- +title: "CONTRIBUTING" +output: html_document +--- + +# Contributing to CONTRIBUTING.md + +First off, thanks for taking the time to contribute! + +All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. + +> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: +> - Star the project +> - Refer this project in your project's readme +> - Mention the project at local meetups and tell your friends/colleagues +> - Cite these packages in your published works + +## Table of Contents + +- [I Have a Question](#i-have-a-question) +- [I Want To Contribute](#i-want-to-contribute) +- [Reporting Bugs](#reporting-bugs) +- [Suggesting Enhancements](#suggesting-enhancements) +- [Your First Code Contribution](#your-first-code-contribution) +- [Improving The Documentation](#improving-the-documentation) +- [Styleguides](#styleguides) +- [Commit Messages](#commit-messages) +- [Join The Project Team](#join-the-project-team) + + +## I Have a Question + +> If you want to ask a question, we assume that you have read the available [Documentation](https://nationalparkservice.github.io/NPSutils/). + +Before you ask a question, it is best to search for existing [Issues](https://github.com/nationalparkservice/NPSutils/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. + +If you then still feel the need to ask a question and need clarification, we recommend the following: + +- Open an [Issue](https://github.com/nationalparkservice/NPSutils/issues/new/choose). +- Provide as much context as you can about what you're running into. +- Provide project and platform versions , depending on what seems relevant. + +We will then take care of the issue as soon as possible. + + + +## I Want To Contribute + +> ### Legal Notice +> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. + +### Reporting Bugs + + +#### Before Submitting a Bug Report + +A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. + +- Make sure that you are using the latest version. +- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://nationalparkservice.github.io/NPSutils/). If you are looking for support, you might want to check [this section](#i-have-a-question)). +- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/nationalparkservice/NPSutils/issues/new/choose). +- Also make sure to search the internet to see if users outside of the GitHub community have discussed the issue. +- Collect information about the bug: +- Stack trace (Traceback) +- OS, Platform and Version (Windows, Linux, macOS, x86, ARM) +- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant. +- Possibly your input and the output +- Can you reliably reproduce the issue? And can you also reproduce it with older versions? + + +#### How Do I Submit a Good Bug Report? + +> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to robert_baker@nps.gov. + + +We use GitHub issues to track bugs and errors. If you run into an issue with the project: + +- Open an [Issue](https://github.com/nationalparkservice/NPSutils/issues/new/choose). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) +- Explain the behavior you would expect and the actual behavior. +- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. See [https://gist.github.com/hadley/270442](https://gist.github.com/hadley/270442) for a great run down on how to create reproducible examples. +- Provide the information you collected in the previous section. + +Once it's filed: + +- The project team will label the issue accordingly. +- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. +- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags, and the issue will be left to be implemented by someone on the development team. You may also address the issue yourself and issue a pull request, which will be reviewed by the development team. + +### Suggesting Enhancements + +This section guides you through submitting an enhancement **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. + + +#### Before Submitting an Enhancement + +- Make sure that you are using the latest version. +- Read the [documentation](https://nationalparkservice.github.io/NPSutils/) carefully and find out if the functionality is already covered, maybe by an individual configuration. +- Perform a [search](https://github.com/nationalparkservice/NPSutils/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. +- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library or package. +- Please consult with the developers if you would like to create an add-on package. Maybe we can help! + + +#### How Do I Submit a Good Enhancement Suggestion? + +Enhancement suggestions are tracked as [GitHub issues](https://github.com/nationalparkservice/NPSutils/issues). + +- Use a **clear and descriptive title** for the issue to identify the suggestion. +- Provide a **step-by-step description of the suggested enhancement** in as many details as possible. +- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. +- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. +- **Explain why this enhancement would be useful** to most users. You may also want to point out the other projects that solved it better and which could serve as inspiration. + +### Your First Code Contribution +If you would like to contribute code please make the adjustments and issue a pull request. The development team will review your code prior to merging and pull request. Before issuing a pull request make sure: +1) You have added a description of any changes made to the changelog in NEWS.md +2) If you have added a function, make sure you also include unit tests that cover the function. If you have changed a function, make sure the unit tests still pass. +3) If you have added or changed a function, make sure that the package loads using `devtools::load_all()`. +2) You have updated any necessary documentation using `devtools::document()` +3) You have updated the associated web pages using `pkgdown::build_site_github_pages()` +4) You have checked that there are no errors or warnings when the package is built using `devtools::check()`. + +## Styleguides +We encourage the use of the [tidyverse style guide](https://style.tidyverse.org/). + +### Commit Messages +Commit messages should be short and descriptive. + + +## Attribution +This guide is based on the **contributing.md**. [Make your own](https://contributing.md/)! From 3be9478c488b453b643f25a3b2865e6c805c6d3a Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 21 Feb 2025 16:52:44 -0700 Subject: [PATCH 2/7] add info about new contributing.md file --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 30d0cab..b3cdbfd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# NPSutils 1.0.1 (development version) +## 2025-02-22 + * Add `CONTRIBUTING.md` file. + # NPSutils 1.0.0 ## 2025-01-22 * Update license to CC0. From 4abd99e37eea4df104dff46dc21955197ff041d1 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Fri, 21 Feb 2025 16:53:13 -0700 Subject: [PATCH 3/7] updated via devtools::document and pkgdown::build_site_github_pages() --- docs/404.html | 112 +++---- docs/LICENSE-text.html | 96 +++--- docs/LICENSE.html | 89 ++--- docs/articles/NPSutils.html | 119 +++---- docs/articles/index.html | 91 +++--- docs/authors.html | 113 +++---- docs/index.html | 119 +++---- docs/news/index.html | 112 +++---- docs/pkgdown.js | 184 +++++++---- docs/pkgdown.yml | 7 +- docs/reference/NPSutils-package.html | 112 +++---- docs/reference/check_is_data_package.html | 116 +++---- docs/reference/check_new_version.html | 119 +++---- docs/reference/check_ref_exists.html | 116 +++---- docs/reference/get_data_packages.html | 132 ++++---- docs/reference/get_new_version_id.html | 116 +++---- docs/reference/get_park_code.html | 116 +++---- docs/reference/get_park_taxon_citations.html | 120 +++---- docs/reference/get_park_taxon_refs.html | 118 +++---- docs/reference/get_park_taxon_url.html | 116 +++---- docs/reference/get_ref_info.html | 115 +++---- docs/reference/get_unit_code.html | 120 +++---- docs/reference/get_unit_code_info.html | 116 +++---- docs/reference/get_unit_info.html | 116 +++---- docs/reference/index.html | 321 ++++++++++--------- docs/reference/load_data_packages.html | 120 +++---- docs/reference/load_pkg_metadata.html | 116 +++---- docs/reference/map_wkt.html | 120 +++---- docs/reference/rm_local_packages.html | 116 +++---- docs/sitemap.xml | 63 ++-- man/NPSutils-package.Rd | 1 + man/get_data_packages.Rd | 14 +- 32 files changed, 1560 insertions(+), 2001 deletions(-) diff --git a/docs/404.html b/docs/404.html index 193ed2c..3c6d76b 100644 --- a/docs/404.html +++ b/docs/404.html @@ -4,103 +4,73 @@ - + Page not found (404) • NPSutils - - - - - - - + + + + + - - - -
-
-
- Content not found. Please use links in the navbar. -
- - - +
- -
- diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 6527f5c..98bedf7 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -1,78 +1,54 @@ -License • NPSutils - - -
-
-
-
YEAR: 2022
 COPYRIGHT HOLDER: NPSutils authors
 
-
+
- +
- - -
- -
-

Site built with pkgdown 2.1.0.

+ -
- + diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 0b3962b..29f47d8 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -1,52 +1,36 @@ -CC0 1.0 Universal • NPSutils - - -
-
+
- diff --git a/docs/articles/NPSutils.html b/docs/articles/NPSutils.html index 583e6a8..c07d01e 100644 --- a/docs/articles/NPSutils.html +++ b/docs/articles/NPSutils.html @@ -4,82 +4,64 @@ - + NPSutils • NPSutils - - - - - - - + + + + + - - - -
-
-
- +library(NPSutils)

NPS Data Store Utilities

@@ -102,33 +84,26 @@

Install from GitHub# install.packages("devtools") devtools::install_github("nationalparkservice/NPSdataverse")

-
- - - +
-
- diff --git a/docs/articles/index.html b/docs/articles/index.html index b98cae9..701bdb5 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,75 +1,56 @@ -Articles • NPSutils - - -
-
-
-

All vignettes

-

+
NPSutils
-
-
+
-
- +
diff --git a/docs/authors.html b/docs/authors.html index baa4b2e..1c0b37f 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,55 +1,39 @@ -Authors and Citation • NPSutils - - -
-
-
-
- +
+
+
+
+ +
+

Authors

  • Robert Baker. Author, maintainer. @@ -63,43 +47,42 @@

    Authors and Citation

    Judd Patterson. Author.

  • +
  • +

    Sarah E. Wright. Author. +

    +
-
-
-

Citation

- Source: DESCRIPTION -
-
+
+

Citation

+

Source: DESCRIPTION

-

Baker R, DeVivo J, Patterson J (2025). +

Baker R, DeVivo J, Patterson J, Wright SE (2025). NPSutils: Collection of Functions to read and manipulate information from the NPS DataStore. -R package version 1.0.0, https://nationalparkservice.github.io/NPSutils/. +R package version 1.0.0, https://nationalparkservice.github.io/NPSutils/.

-
@Manual{,
+      
@Manual{,
   title = {NPSutils: Collection of Functions to read and manipulate information from the NPS DataStore},
-  author = {Robert Baker and Joe DeVivo and Judd Patterson},
+  author = {Robert Baker and Joe DeVivo and Judd Patterson and Sarah E. Wright},
   year = {2025},
   note = {R package version 1.0.0},
   url = {https://nationalparkservice.github.io/NPSutils/},
 }
+
-
- -
- +
-
- +
diff --git a/docs/index.html b/docs/index.html index 01b4ce7..eda7af1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,72 +4,50 @@ - + Collection of Functions to read and manipulate information from the NPS DataStore • NPSutils - - - - - - + + + + + + - - - - -
-
- +
-
+ 1.0.0 + + + + + +
+
+
+
@@ -88,10 +66,7 @@

Install from GitHubpak::pkg_install("nationalparkservice/NPSdataverse")

-
- - +
-
- diff --git a/docs/news/index.html b/docs/news/index.html index befe360..7dea868 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -1,57 +1,47 @@ -Changelog • NPSutils - - -
-
+
-
- +
+
+
- +

NPSutils 1.0.1 (development version)

+
+

2025-02-22

+
  • Add CONTRIBUTING.md file.
  • +
+
+
+

NPSutils 1.0.0

2025-01-22

  • Update license to CC0. ## 2025-01-19
  • @@ -77,7 +67,7 @@

    2024-12-19 - +

    NPSutils 0.3.2 “Lost Coast”

    • Add new functions, load_data_packages() and load_data_package(), which can load data packages (EML in .xml and data in .csv) similarly to the deprecated load_data_package_deprecated() function but also allows the data types in the tibbles loaded to be specified based on the information in the metadata.
    • Deprecate load_data_package() and rename it to load_data_package_deprecated().
    • Update readme to us pak for package installation instead of devtools.
    • @@ -88,12 +78,12 @@
- +

NPSutils 0.3.1 “Ooh Aah Point”

  • added private functions .get_authors() and .get_contacts() to retrieve authors and contacts (and emails) from EML
  • added load_EML_df(), which retrieves commonly available metadata items from an EML-formatted R object and returns them as a single dataframe (for loading into Power BI)
- +

NPSutils 0.3.0

  • updated all datastore api requests from v4/v5 to v6 (units service remains at v2)
  • add global variables for base datastore api urls and helper functions to access them in utils.R
  • added new functionality to get_data_packages(): it will now check to see if a DataStore reference ID is invalid or not. It will also check whether the reference is a data package or not. Substantial feedback is reported to the user if the flag force is set to FALSE.
  • @@ -114,11 +104,11 @@
- +

NPSutils 0.2.0.3

  • added map_wkt() function to map points, polygons, or both from Well Known Text coordinates (WKT). WKT is used in place to GPS coordinates when sensitive species locations have been “fuzzed”. In this case, providing a polygon rather than the an exact (albeit fuzzed) is preferable as it is clear that the location is not exact. WKT is an efficient way to store geographic shapes such as polygons in flat files such as .csv.
- +

NPSutils 0.2.0.1

  • updated get_data_package to retrieve 1 or more files from a given reference, if for instance a data package has multiple files associated with it. get_data_package is file extension agnostic.
  • get_data_package can now take a list of reference IDs from data store. It will write a separate folder for each reference (within a /data folder) and put the data files in the relevant folder.
  • get_data_package can now specify the directory that the /data folder and all child data package folders and data files are saved to. Defaults to the working directory.
  • @@ -127,35 +117,29 @@
- +

NPSutils 0.2.0.0

Facelift to the entire package:

  • Functions and parameters have snake_case names
  • Tidyverse styling via styler
  • Added bare-bones pkgdown site
- +

NPSutils 0.1.0.0

  • Added a NEWS.md file to track changes to the package.
-
+
- +
- -
- +
diff --git a/docs/pkgdown.js b/docs/pkgdown.js index 6f0eee4..1a99c65 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -2,83 +2,43 @@ (function($) { $(function() { - $('.navbar-fixed-top').headroom(); + $('nav.navbar').headroom(); - $('body').css('padding-top', $('.navbar').height() + 10); - $(window).resize(function(){ - $('body').css('padding-top', $('.navbar').height() + 10); + Toc.init({ + $nav: $("#toc"), + $scope: $("main h2, main h3, main h4, main h5, main h6") }); - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); + if ($('#toc').length) { + $('body').scrollspy({ + target: '#toc', + offset: $("nav.navbar").outerHeight() + 1 + }); } - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } + // Activate popovers + $('[data-bs-toggle="popover"]').popover({ + container: 'body', + html: true, + trigger: 'focus', + placement: "top", + sanitize: false, + }); - return(haystack.length); - } + $('[data-bs-toggle="tooltip"]').tooltip(); /* Clipboard --------------------------*/ function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-original-title'); - element.setAttribute('data-original-title', msg); + var tooltipOriginalTitle=element.getAttribute('data-bs-original-title'); + element.setAttribute('data-bs-original-title', msg); $(element).tooltip('show'); - element.setAttribute('data-original-title', tooltipOriginalTitle); + element.setAttribute('data-bs-original-title', tooltipOriginalTitle); } if(ClipboardJS.isSupported()) { $(document).ready(function() { - var copyButton = ""; + var copyButton = ""; $("div.sourceCode").addClass("hasCopyButton"); @@ -89,20 +49,114 @@ $('.btn-copy-ex').tooltip({container: 'body'}); // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + var clipboard = new ClipboardJS('[data-clipboard-copy]', { text: function(trigger) { return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); } }); - clipboardBtnCopies.on('success', function(e) { + clipboard.on('success', function(e) { changeTooltipMessage(e.trigger, 'Copied!'); e.clearSelection(); }); - clipboardBtnCopies.on('error', function() { + clipboard.on('error', function(e) { changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); }); + }); } + + /* Search marking --------------------------*/ + var url = new URL(window.location.href); + var toMark = url.searchParams.get("q"); + var mark = new Mark("main#main"); + if (toMark) { + mark.mark(toMark, { + accuracy: { + value: "complementary", + limiters: [",", ".", ":", "/"], + } + }); + } + + /* Search --------------------------*/ + /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ + // Initialise search index on focus + var fuse; + $("#search-input").focus(async function(e) { + if (fuse) { + return; + } + + $(e.target).addClass("loading"); + var response = await fetch($("#search-input").data("search-index")); + var data = await response.json(); + + var options = { + keys: ["what", "text", "code"], + ignoreLocation: true, + threshold: 0.1, + includeMatches: true, + includeScore: true, + }; + fuse = new Fuse(data, options); + + $(e.target).removeClass("loading"); + }); + + // Use algolia autocomplete + var options = { + autoselect: true, + debug: true, + hint: false, + minLength: 2, + }; + var q; +async function searchFuse(query, callback) { + await fuse; + + var items; + if (!fuse) { + items = []; + } else { + q = query; + var results = fuse.search(query, { limit: 20 }); + items = results + .filter((x) => x.score <= 0.75) + .map((x) => x.item); + if (items.length === 0) { + items = [{dir:"Sorry 😿",previous_headings:"",title:"No results found.",what:"No results found.",path:window.location.href}]; + } + } + callback(items); +} + $("#search-input").autocomplete(options, [ + { + name: "content", + source: searchFuse, + templates: { + suggestion: (s) => { + if (s.title == s.what) { + return `${s.dir} >
    ${s.title}
    `; + } else if (s.previous_headings == "") { + return `${s.dir} >
    ${s.title}
    > ${s.what}`; + } else { + return `${s.dir} >
    ${s.title}
    > ${s.previous_headings} > ${s.what}`; + } + }, + }, + }, + ]).on('autocomplete:selected', function(event, s) { + window.location.href = s.path + "?q=" + q + "#" + s.id; + }); + }); })(window.jQuery || window.$) + +document.addEventListener('keydown', function(event) { + // Check if the pressed key is '/' + if (event.key === '/') { + event.preventDefault(); // Prevent any default action associated with the '/' key + document.getElementById('search-input').focus(); // Set focus to the search input + } +}); diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index c4531ec..121dd3f 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,6 +1,9 @@ pandoc: '3.2' -pkgdown: 2.1.0 +pkgdown: 2.1.1 pkgdown_sha: ~ articles: NPSutils: NPSutils.html -last_built: 2025-01-22T22:27Z +last_built: 2025-02-21T23:49Z +urls: + reference: https://nationalparkservice.github.io/NPSutils/reference + article: https://nationalparkservice.github.io/NPSutils/articles diff --git a/docs/reference/NPSutils-package.html b/docs/reference/NPSutils-package.html index 9043c04..af25742 100644 --- a/docs/reference/NPSutils-package.html +++ b/docs/reference/NPSutils-package.html @@ -1,91 +1,71 @@ -NPSutils: Collection of Functions to read and manipulate information from the NPS DataStore — NPSutils-package • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    NPSutils is a collection of functions for interacting with NPS DataStore repository.

    -
    -

    See also

    -

    Useful links:

    +
    -
    - +
    diff --git a/docs/reference/check_is_data_package.html b/docs/reference/check_is_data_package.html index 334aa53..36cba56 100644 --- a/docs/reference/check_is_data_package.html +++ b/docs/reference/check_is_data_package.html @@ -1,66 +1,50 @@ -Check whether reference is a data package — check_is_data_package • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    The function tests whether a valid DataStore reference is a data package or not. If it is a data package, the value "TRUE" is returned. If it is not a data package, the value FALSE is returned. The default setting assumes the user is logged on to the VPN (secure = TRUE), but this can be set to secure = FALSE for non-NPS users. This is a relatively simple helper function that will not test whether a reference exists and may produce unexpected errors if the reference does not exist or is not accessible. You are advised to run `check_reference_exists()` prior to using this function.

    -
    +
    +

    Usage

    check_is_data_package(reference_id, secure = TRUE, dev = FALSE)
    -
    -

    Arguments

    +
    +

    Arguments

    reference_id
    @@ -75,36 +59,32 @@

    Arguments

    Logical. Defaults to FALSE, indicating that the user wishes to work with the production version of DataStore. Can be set to TRUE if the user wants to work with the development environment on DataStore. Setting dev = TRUE will only work if the user has the appropriate permissions. Requires secure = TRUE.

    -
    -

    Value

    +
    +

    Value

    Logical.FALSE if the DataStore reference is not a data package. TRUE if the DataStore reference is a data package.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     check_is_data_package(1234567)
     check_is_data_package(1234567, secure = FALSE)
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/check_new_version.html b/docs/reference/check_new_version.html index 138a61a..f53f4f8 100644 --- a/docs/reference/check_new_version.html +++ b/docs/reference/check_new_version.html @@ -1,68 +1,53 @@ -Checks whether a reference has a more recent version — check_new_version • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    This function tests whether an existing and accessible DataStore reference has a newer version or not. If a newer version exists, the value "TRUE" is returned. If a newer version does not exist, the value FALSE is returned. The default setting assumes the user is logged on to the VPN (secure = TRUE), but this can be set to secure = FALSE for non-NPS users. This is a relatively simple helper function that will not test whether a reference exists and may produce unexpected errors if the reference does not exist or is not accessible. You are advised to run `check_reference_exists()` prior to using this function.

    -
    +
    +

    Usage

    check_new_version(reference_id, secure = TRUE, dev = FALSE)
    -
    -

    Arguments

    +
    +

    Arguments

    reference_id
    @@ -77,37 +62,33 @@

    Arguments

    Logical. Defaults to FALSE, indicating that the user wishes to work with the production version of DataStore. Can be set to TRUE if the user wants to work with the development environment on DataStore. Setting dev = TRUE will only work if the user has the appropriate permissions. Requires secure = TRUE.

    -
    -

    Value

    +
    +

    Value

    Logical. TRUE if a newer version exists, FALSE if a newer version does not exist.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     check_new_version(1234567)
     check_new_version(1234567, secure = FALSE)
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/check_ref_exists.html b/docs/reference/check_ref_exists.html index 5acfb49..5c0722f 100644 --- a/docs/reference/check_ref_exists.html +++ b/docs/reference/check_ref_exists.html @@ -1,66 +1,50 @@ -Check whether a reference exists on DataStore — check_ref_exists • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    given a DataStore reference ID, the function will hit the DataStore API to determine whether the reference exists. If it cannot contact DataStore, it will stop with an error that states the connection failed.

    -
    +
    +

    Usage

    check_ref_exists(reference_id, secure = TRUE, dev = FALSE)
    -
    -

    Arguments

    +
    +

    Arguments

    reference_id
    @@ -75,36 +59,32 @@

    Arguments

    Logical. Defaults to FALSE, indicating that the user wishes to work with the production version of DataStore. Can be set to TRUE if the user wants to work with the development environment on DataStore. Setting dev = TRUE will only work if the user has the appropriate permissions. Requires secure = TRUE.

    -
    -

    Value

    +
    +

    Value

    logical. TRUE means the reference exists, false means it does not exist.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     check_ref_exists(1234567)
     check_ref_exists(1234567, secure = FALSE)
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/get_data_packages.html b/docs/reference/get_data_packages.html index 77346ec..fb45326 100644 --- a/docs/reference/get_data_packages.html +++ b/docs/reference/get_data_packages.html @@ -1,61 +1,45 @@ -Retrieve digital data package holding(s) from DataStore. — get_data_packages • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    `get_data_packages()` creates a directory called "data" in the current working directory (or user-specified location, see the `path` option). For each data package, it writes a new sub-directory within the "data" directory named with the corresponding data package reference ID. All the data package files are then copied to the directory specific to the data package.

    -
    +
    +

    Usage

    get_data_packages(
       reference_id,
       secure = FALSE,
    @@ -73,8 +57,8 @@ 

    Retrieve digital data package holding(s) from DataStore.

    )
    -
    -

    Arguments

    +
    +

    Arguments

    reference_id
    @@ -98,51 +82,47 @@

    Arguments

    Logical. Defaults to FALSE. FALSE indicates all operations will be performed in DataStore's production environment. Setting dev = TRUE enables running functions against the DataStore development environment. Working in the development environment will allow you to test functions and code without affecting the publicly accessible DataStore application.

    -
    -

    Value

    +
    +

    Value

    String. The path (including the /data folder) where all data package sub-directories and data files are contained.

    -
    -

    Details

    +
    +

    Details

    In the default mode (force = FALSE), `get_data_packages()` will inform a user if the directory for that data package already exists and give the user the option to overwrite it (or skip downloading). In the default mode (force = FALSE), `get_data_packages()` will also check to see if there are newer versions of the requested data package and if there are newer versions, `get_data_packages()` will inform the user of when the requested data package was issued, when the newest data package was issued, and will then ask the user if they would like to download the newest version instead of the requested version. In the default mode (force = FALSE), `get_data_packages()` will warn a user if the reference ID supplied was not found (does not exist or requires VPN) and if a reference ID refers to a product that is not a data package, `get_data_packages()` will ask if the user wants to attempt to download it anyway. `get_data_packages()` will automatically time out if any individual file download exceeds 300 seconds (5 minutes). Very large files or slow internet connections may hit this limit.

    Although `get_data_packages()` is designed to handle the data package reference type on DataStore, it should in theory work on any reference type and download all files associated with a reference (it ignores web links/web resources associated with a reference). If the reference includes a .zip file, the file will be downloaded and the contents extracted. The original .zip archive file will then be deleted. If the .zip contains files with the same name as files in the parent directory, the parent directory files will be over-written by the contents of the .zip archive.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
    -#get a public data package
    +# get a public data package
     get_data_packages(2300498, secure = FALSE)
     
    -#get a list of data packages, some public some restricted
    +# get a list of data packages, some public some restricted
     get_data_packages(c(2272461, 1234567, 7654321), secure = TRUE)
     
    -#pass a list of data packages to retrieve to the function:
    -data_packages<-c(2272461, 1234567, 7654321)
    -get_data_packages(data_packages, secure = TRUE, path="../../my_custom_directory")
    +# pass a list of data packages to retrieve to the function:
    +data_packages <- c(2272461, 1234567, 7654321)
    +get_data_packages(data_packages, secure = TRUE, path = "../../my_custom_directory")
     
    -#get a data package and return the path the data package is saved to
    +# get a data package and return the path the data package is saved to
     pathToDataForPiping <- get_data_packages(2272461, secure = TRUE, force = FALSE)
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/get_new_version_id.html b/docs/reference/get_new_version_id.html index f846de8..5bc61c2 100644 --- a/docs/reference/get_new_version_id.html +++ b/docs/reference/get_new_version_id.html @@ -1,66 +1,50 @@ -Get newest DataStore reference version — get_new_version_id • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    If a DataStore reference has been versioned, `get_new_version_id()` will return the DataStore reference ID for the newest version. If the reference has not been versioned, the function returns NULL.

    -
    +
    +

    Usage

    get_new_version_id(reference_id, secure = TRUE, dev = FALSE)
    -
    -

    Arguments

    +
    +

    Arguments

    reference_id
    @@ -75,36 +59,32 @@

    Arguments

    Logical. Defaults to FALSE, indicating that the user wishes to work with the production version of DataStore. Can be set to TRUE if the user wants to work with the development environment on DataStore. Setting dev = TRUE will only work if the user has the appropriate permissions. Requires secure = TRUE.

    -
    -

    Value

    +
    +

    Value

    Integer. A 7-digit integer corresponding to the DataStore reference ID for the newest version of the supplied DataStore reference. If the supplied reference has not been versioned, NULL is returned.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     get_new_version_id(1234567)
     get_new_version_id(1234567, secure = FALSE)
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/get_park_code.html b/docs/reference/get_park_code.html index 8ac6ab0..84473fd 100644 --- a/docs/reference/get_park_code.html +++ b/docs/reference/get_park_code.html @@ -1,101 +1,81 @@ -Restricts get_unit_code to just National Parks — get_park_code • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    `get_park_code` is identical to `get_unit_code` except the output is restricted to just National Parks (as opposed to including networks, etc.). Accesses info from irmaservices.nps.gov. Search for park or park unit with any string and return all applicable national park unitCodes.

    -
    +
    +

    Usage

    get_park_code(park)
    -
    -

    Arguments

    +
    +

    Arguments

    park

    is a case-insensitive string containing some part of the unit's FullName, e.g "Yellow".

    -
    -

    Value

    +
    +

    Value

    one data frame to the global environment. May contain multiple matches.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     get_park_code("Yellow")
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/get_park_taxon_citations.html b/docs/reference/get_park_taxon_citations.html index bc18deb..9a5e341 100644 --- a/docs/reference/get_park_taxon_citations.html +++ b/docs/reference/get_park_taxon_citations.html @@ -1,70 +1,56 @@ -Get DataStore Citations for a park-species combination — get_park_taxon_citations • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    get_park_taxon_citations returns a vector of citations in Data Store corresponding to a particular taxon at a park.

    Because `get_park_taxon_citations()` accesses restricted data on the secure DataStore server, results of these queries need to be considered for potential park-specific data protection protocols.

    Note that this function only returns citations that have been "tagged" with a taxon code and may represent only a subset of references that have information about a taxon.

    -
    +
    +

    Usage

    get_park_taxon_citations(park_code, taxon_code)
    -
    -

    Arguments

    +
    +

    Arguments

    park_code
    @@ -75,35 +61,31 @@

    Arguments

    The IRMA taxon code.

    -
    -

    Value

    +
    +

    Value

    a dataframe

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     get_park_taxon_citations("APIS", 126749)
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/get_park_taxon_refs.html b/docs/reference/get_park_taxon_refs.html index b37d2e4..667907d 100644 --- a/docs/reference/get_park_taxon_refs.html +++ b/docs/reference/get_park_taxon_refs.html @@ -1,61 +1,48 @@ -Get DS References for a park-species combination — get_park_taxon_refs • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    get_park_taxon_refs returns a data frame of metadata for references in Data Store corresponding to a particular taxon at a park. The resultant data frame is then usable by other functions to extract metadata from the records.

    Because `get_park_taxon_refs()` accesses restricted data on the secure DataStore server, results of these queries need to be considered for potential park-specific data protection protocols.

    @@ -63,12 +50,13 @@

    Get DS References for a park-species combination

    subset of references that have information about a taxon.

    -
    +
    +

    Usage

    get_park_taxon_refs(park_code, taxon_code)
    -
    -

    Arguments

    +
    +

    Arguments

    park_code
    @@ -80,30 +68,26 @@

    Arguments

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     get_park_taxon_refs("APIS", 126749)
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/get_park_taxon_url.html b/docs/reference/get_park_taxon_url.html index 8a0f457..7415fa6 100644 --- a/docs/reference/get_park_taxon_url.html +++ b/docs/reference/get_park_taxon_url.html @@ -1,66 +1,50 @@ -Get URL for references for a park-species combination — get_park_taxon_url • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    get_park_taxon_url returns a vector of URLs for references in Data Store corresponding to a particular taxon at a park.

    -
    +
    +

    Usage

    get_park_taxon_url(park_code, taxon_code)
    -
    -

    Arguments

    +
    +

    Arguments

    park_code
    @@ -71,36 +55,32 @@

    Arguments

    The IRMA taxon code.

    -
    -

    Details

    +
    +

    Details

    Note that this function only returns URLs for references that have been "tagged" with a taxon code and may represent only a subset of references that have information about a taxon.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     get_park_taxon_url("APIS", 126749)
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/get_ref_info.html b/docs/reference/get_ref_info.html index 1ca5a40..3865733 100644 --- a/docs/reference/get_ref_info.html +++ b/docs/reference/get_ref_info.html @@ -1,68 +1,53 @@ -Get citation for Data Store holding info by HoldingID — get_ref_info • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    get_ref_info returns a character string or a vector with information from one of the metadata fields in a Data Store reference's associated xml file.

    -
    +
    +

    Usage

    get_ref_info(holding_id, field)
    -
    -

    Arguments

    +
    +

    Arguments

    holding_id
    @@ -76,30 +61,26 @@

    Arguments

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     get_ref_info(2266196, "Title")
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/get_unit_code.html b/docs/reference/get_unit_code.html index d8299f0..0942b23 100644 --- a/docs/reference/get_unit_code.html +++ b/docs/reference/get_unit_code.html @@ -1,107 +1,87 @@ -Dynamically access NPS park unit code data — get_unit_code • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    Accesses info from irmaservices.nps.gov. Search for park or park unit with any string and return all applicable UnitCodes.

    -
    +
    +

    Usage

    get_unit_code(unit)
    -
    -

    Arguments

    +
    +

    Arguments

    unit

    is a case-insensitive string containing some part of the unit's FullName.

    -
    -

    Value

    +
    +

    Value

    one data frame to the global environment. May contain multiple matches.

    -
    -

    Details

    +
    +

    Details

    Contains multiple somewhat redundant functions for searching park units including unit codes, names, states, regions, networks, regions, etc. These functions can be handy if you need to supply the unit code when downloading data but only know the park name, if you have a unit code but don't know what park, region, etc it refers to, or if you want to know all the parks that are within a given network, region, or state (note: it will actually supply all park units, not just National Parks). Regions do NOT use the region numbering system because the underlying data this code draws on from irma does not include the region numbers.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     get_unit_code("ROMO")
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/get_unit_code_info.html b/docs/reference/get_unit_code_info.html index 2009009..c2d1d5b 100644 --- a/docs/reference/get_unit_code_info.html +++ b/docs/reference/get_unit_code_info.html @@ -1,101 +1,81 @@ -Gets information about a park Unit Code — get_unit_code_info • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    `get_unit_code_info` accesses info from irmaservices.nps.gov and allows you to search a Park Unit Code and determine which park, network, or other entity it is associated with along with ancillary information.

    -
    +
    +

    Usage

    get_unit_code_info(code)
    -
    -

    Arguments

    +
    +

    Arguments

    code

    is a case-insensitive string. It typically is 4 letters long and typically does not include numbers but may be longer, shorter, or include special characters such as "-", e.g. "SFCN".

    -
    -

    Value

    +
    +

    Value

    one data frame to the global environment. May contain multiple matches. Sufficient detail should be provided to determine the intended Park Unit's name. Data frame includes UnitCode, FullName, UnitLifeCycle, Network, Region, and StateCodes.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     get_unit_code_info("SFCN")
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/get_unit_info.html b/docs/reference/get_unit_info.html index 328d4dd..11ad0d6 100644 --- a/docs/reference/get_unit_info.html +++ b/docs/reference/get_unit_info.html @@ -1,61 +1,45 @@ -Search irmaservices.nps using any piece of information. — get_unit_info • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    `get_unit_info` accesses info from irmaservices.nps.gov and allows you to search a Park Unit based on any number or combination of parameters. Not all parameters need to be specified, but it is probably worth specifying which parameters ARE specified, e.g. get.unitInfo(LifeCycle="Inactive"). If the arguments are not specified, they will default to the order supplied in the function.

    -
    +
    +

    Usage

    get_unit_info(
       code = NULL,
       park = NULL,
    @@ -68,8 +52,8 @@ 

    Search irmaservices.nps using any piece of information.

    )
    -
    -

    Arguments

    +
    +

    Arguments

    code
    @@ -105,35 +89,31 @@

    Arguments

    defaults to NULL. Is a case-insensitive search of the park unit's state. States are indicated using 2-letter abbreviations. Park units may span multiple states. Not all parks have state designations.

    -
    -

    Value

    +
    +

    Value

    one data frame to the global environment. May contain multiple matches. Sufficient detail should be provided to determine the intended Park Unit's name.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     get_unit_info(state = "CO")
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/index.html b/docs/reference/index.html index ae7c8f1..19e7052 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,160 +1,187 @@ -Package index • NPSutils - - -
    -
    -
    - +
    +
    +
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    All functions

    -

    -
    -

    check_is_data_package()

    -

    Check whether reference is a data package

    -

    check_new_version()

    -

    Checks whether a reference has a more recent version

    -

    check_ref_exists()

    -

    Check whether a reference exists on DataStore

    -

    get_data_packages() get_data_package()

    -

    Retrieve digital data package holding(s) from DataStore.

    -

    get_new_version_id()

    -

    Get newest DataStore reference version

    -

    get_park_code()

    -

    Restricts get_unit_code to just National Parks

    -

    get_park_taxon_citations()

    -

    Get DataStore Citations for a park-species combination

    -

    get_park_taxon_refs()

    -

    Get DS References for a park-species combination

    -

    get_park_taxon_url()

    -

    Get URL for references for a park-species combination

    -

    get_refs_info()

    -

    Return Basic information about a list of DataStore References

    -

    get_ref_info()

    -

    Get citation for Data Store holding info by HoldingID

    -

    get_ref_list()

    -

    Get a list of reference codes from DataStore

    -

    get_unit_code()

    -

    Dynamically access NPS park unit code data

    -

    get_unit_code_info()

    -

    Gets information about a park Unit Code

    -

    get_unit_info()

    -

    Search irmaservices.nps using any piece of information.

    -

    load_core_metadata()

    -

    Gets common EML metadata elements and puts them in a dataframe #' `r lifecycle::badge('experimental')`

    -

    load_data_packages() load_data_package()

    -

    Read contents of data package(s) and return a list of tibbles list of tibbles based on the data file(s). Can use metadata to specify data types.

    -

    load_pkg_metadata()

    -

    Loads EML-formatted metadata into R for inspection and/or editing

    -

    map_wkt()

    -

    Map WKT geometry (points and polygons)

    -

    rm_local_packages()

    -

    Delete data packages from your local machine

    -

    summarize_packages()

    -

    Collect summary statistics on data packages

    - - -
    +
    +

    All functions

    -
    + + +
    -
    + +
    diff --git a/docs/reference/load_data_packages.html b/docs/reference/load_data_packages.html index 8722275..063afa9 100644 --- a/docs/reference/load_data_packages.html +++ b/docs/reference/load_data_packages.html @@ -1,61 +1,45 @@ -Read contents of data package(s) and return a list of tibbles list of tibbles based on the data file(s). Can use metadata to specify data types. — load_data_packages • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    `load_data_packages()` loads one to many data packages and returns a list. If only one data package is loaded, the list will be a list of tibbles where each tibble is a data (.csv) file from the data package. If multiple data packages are loaded, the list will be a list of lists where each nested list contains a list of tibble and each tibble is a data file (.csv). See `simplify` below for details on handling these lists.

    -
    +
    +

    Usage

    load_data_packages(
       reference_id,
       directory = here::here("data"),
    @@ -71,8 +55,8 @@ 

    Read contents of data package(s) and return a list of tibbles list of tibble )

    -
    -

    Arguments

    +
    +

    Arguments

    reference_id
    @@ -91,41 +75,37 @@

    Arguments

    Logical. Defaults to TRUE. If `simplify = TRUE`, the function will return a list of tibbles where each tibble is a data file from the data package(s) specified. The tibbles are named using the following format: "pkg_<reference_id.filename" (without the filename extension). If you want to load each individual data file into R for further processing, use `simplify = TRUE` and then run `list2env(x, envir=.GlobalEnv)`. If you set `simplify = FALSE`, the object returned will either be a list of tibbles identical to that returned by `simplify = TRUE` (if only one data package is loaded) or will be a list of lists where each nested list is a contains one tibble for each data file in each data package.Setting `simplify = FALSE` may make it easier to do post-processing on a package-by-package level rather than a tibble-by-tibble level.

    -
    -

    Value

    +
    +

    Value

    a list of (of lists of) tibbles.

    -
    -

    Details

    +
    +

    Details

    currently `load_data_packages()` only supports EML metadata and .csv files. The reference_id '

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     dat <- load_data_packages(2272461)
     } # }
     
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/load_pkg_metadata.html b/docs/reference/load_pkg_metadata.html index d0bcc13..0f42aca 100644 --- a/docs/reference/load_pkg_metadata.html +++ b/docs/reference/load_pkg_metadata.html @@ -1,66 +1,50 @@ -Loads EML-formatted metadata into R for inspection and/or editing — load_pkg_metadata • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    `load_pkg_metadata()` is essentially a wrapper around `DPchecker::load_metadata` with the directory structure pre-set to work well the default location that `get_data_package` stores downloaded data packages. If you did not use the default settings for `get_data_package` (or downloaded a data package manually) you may find it easier to adjust the directory structure pointing to your data package and load the metadata using `DPchecker::load_metadata()`. Much like `load_metadata`, `load_pkg_metadata` requires that there be a single .xml file in the data package directory, that the metadata file name end in *_metadata.xml, and that the file contain schema-valid EML metadata.

    -
    +
    +

    Usage

    load_pkg_metadata(holding_id, directory = "data")
    -
    -

    Arguments

    +
    +

    Arguments

    holding_id
    @@ -71,35 +55,31 @@

    Arguments

    String. Path to the data package directory, defaults to "data".

    -
    -

    Value

    +
    +

    Value

    one data frame to the global environment.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     load_pgk_metadata(2266200)
     } # }
     
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/map_wkt.html b/docs/reference/map_wkt.html index 1638ec9..2a9cfcb 100644 --- a/docs/reference/map_wkt.html +++ b/docs/reference/map_wkt.html @@ -1,61 +1,45 @@ -Map WKT geometry (points and polygons) — map_wkt • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    `map_wkt()` takes a well-known text (WKT) geometry column and maps points and polygons onto a gray leaflet map. All NA geometry is dropped before mapping.

    -
    +
    +

    Usage

    map_wkt(
       df,
       wellknowntext = "footprintWKT",
    @@ -64,8 +48,8 @@ 

    Map WKT geometry (points and polygons)

    )
    -
    -

    Arguments

    +
    +

    Arguments

    df
    @@ -84,17 +68,17 @@

    Arguments

    - Boolean (TRUE or FALSE). Whether or not to remove identical geometries before plotting.

    -
    -

    Value

    +
    +

    Value

    The function returns a dynamic, zoomable leaflet map with the specific geometry plotted.

    -
    -

    Details

    +
    +

    Details

    Define your dataframe, the column that contains WKT, and an option to map specific geometry types.

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     #map species observations
     map_wkt(my_NPS_species_obs)
    @@ -104,23 +88,19 @@ 

    Examples

    } # }
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/rm_local_packages.html b/docs/reference/rm_local_packages.html index 295e192..157ccab 100644 --- a/docs/reference/rm_local_packages.html +++ b/docs/reference/rm_local_packages.html @@ -1,61 +1,45 @@ -Delete data packages from your local machine — rm_local_packages • NPSutils - - -
    -
    -
    - +
    +
    +
    -
    +

    `rm_local_packages()` will delete one or more specified data packages from your local machine (not DataStore). The function assumes that all data packages are in a folder called "data" and will delete items within the folder "data" but will not remove the "data" folder itself. You could just delete the files using Windows explorer. But if you really hate your OS (or just don't like using a mouse) you can do it this way too.

    -
    +
    +

    Usage

    rm_local_packages(
       reference_id,
       all = FALSE,
    @@ -64,8 +48,8 @@ 

    Delete data packages from your local machine

    )
    -
    -

    Arguments

    +
    +

    Arguments

    reference_id
    @@ -84,13 +68,13 @@

    Arguments

    Logical. Defaults to `FALSE`. If set to `TRUE` (for instance for scripting purposes) the output to the console is suppressed.

    -
    -

    Value

    +
    +

    Value

    invisible

    -
    -

    Examples

    +
    +

    Examples

    if (FALSE) { # \dontrun{
     #delete a single local data package:
     delete_packages(1234567)
    @@ -107,23 +91,19 @@ 

    Examples

    } # }
    -
    - -
    +
    -
    - +
    diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 72a6ca7..983cf2e 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,34 +1,35 @@ -/404.html -/articles/index.html -/articles/NPSutils.html -/authors.html -/index.html -/LICENSE-text.html -/LICENSE.html -/news/index.html -/reference/check_is_data_package.html -/reference/check_new_version.html -/reference/check_ref_exists.html -/reference/get_data_packages.html -/reference/get_new_version_id.html -/reference/get_park_code.html -/reference/get_park_taxon_citations.html -/reference/get_park_taxon_refs.html -/reference/get_park_taxon_url.html -/reference/get_refs_info.html -/reference/get_ref_info.html -/reference/get_ref_list.html -/reference/get_unit_code.html -/reference/get_unit_code_info.html -/reference/get_unit_info.html -/reference/index.html -/reference/load_core_metadata.html -/reference/load_data_packages.html -/reference/load_pkg_metadata.html -/reference/map_wkt.html -/reference/NPSutils-package.html -/reference/rm_local_packages.html -/reference/summarize_packages.html +https://nationalparkservice.github.io/NPSutils/404.html +https://nationalparkservice.github.io/NPSutils/articles/index.html +https://nationalparkservice.github.io/NPSutils/articles/NPSutils.html +https://nationalparkservice.github.io/NPSutils/authors.html +https://nationalparkservice.github.io/NPSutils/CONTRIBUTING.html +https://nationalparkservice.github.io/NPSutils/index.html +https://nationalparkservice.github.io/NPSutils/LICENSE-text.html +https://nationalparkservice.github.io/NPSutils/LICENSE.html +https://nationalparkservice.github.io/NPSutils/news/index.html +https://nationalparkservice.github.io/NPSutils/reference/check_is_data_package.html +https://nationalparkservice.github.io/NPSutils/reference/check_new_version.html +https://nationalparkservice.github.io/NPSutils/reference/check_ref_exists.html +https://nationalparkservice.github.io/NPSutils/reference/get_data_packages.html +https://nationalparkservice.github.io/NPSutils/reference/get_new_version_id.html +https://nationalparkservice.github.io/NPSutils/reference/get_park_code.html +https://nationalparkservice.github.io/NPSutils/reference/get_park_taxon_citations.html +https://nationalparkservice.github.io/NPSutils/reference/get_park_taxon_refs.html +https://nationalparkservice.github.io/NPSutils/reference/get_park_taxon_url.html +https://nationalparkservice.github.io/NPSutils/reference/get_refs_info.html +https://nationalparkservice.github.io/NPSutils/reference/get_ref_info.html +https://nationalparkservice.github.io/NPSutils/reference/get_ref_list.html +https://nationalparkservice.github.io/NPSutils/reference/get_unit_code.html +https://nationalparkservice.github.io/NPSutils/reference/get_unit_code_info.html +https://nationalparkservice.github.io/NPSutils/reference/get_unit_info.html +https://nationalparkservice.github.io/NPSutils/reference/index.html +https://nationalparkservice.github.io/NPSutils/reference/load_core_metadata.html +https://nationalparkservice.github.io/NPSutils/reference/load_data_packages.html +https://nationalparkservice.github.io/NPSutils/reference/load_pkg_metadata.html +https://nationalparkservice.github.io/NPSutils/reference/map_wkt.html +https://nationalparkservice.github.io/NPSutils/reference/NPSutils-package.html +https://nationalparkservice.github.io/NPSutils/reference/rm_local_packages.html +https://nationalparkservice.github.io/NPSutils/reference/summarize_packages.html diff --git a/man/NPSutils-package.Rd b/man/NPSutils-package.Rd index cca418e..5d89b61 100644 --- a/man/NPSutils-package.Rd +++ b/man/NPSutils-package.Rd @@ -23,6 +23,7 @@ Authors: \itemize{ \item Joe DeVivo \item Judd Patterson \email{Judd_Patterson@nps.gov} (\href{https://orcid.org/0000-0002-0951-7917}{ORCID}) + \item Sarah E. Wright \email{sarah_wright@nps.gov} (\href{https://orcid.org/0009-0004-5060-2189}{ORCID}) } } diff --git a/man/get_data_packages.Rd b/man/get_data_packages.Rd index 7c1c0ed..5f5fbd2 100644 --- a/man/get_data_packages.Rd +++ b/man/get_data_packages.Rd @@ -28,7 +28,7 @@ get_data_package( \item{path}{String. Indicates the location that the "data" directory and all sub-directories and files should be written to. Defaults to the working directory.} -\item{force}{Logical. Defaults to FALSE. In the FALSE condition, the user is prompted if a directory already exists and asked whether to overwrite it or not. The user is also given information about which files are being downloaded, extracted, deleted, and where they are being written to. The user is also notified if there is a newer version of the requested data package and given the option to download the newest version instead of the requested version. It also provides information about what errors (if any) were encountered and give suggestions on how to address them. +\item{force}{Logical. Defaults to FALSE. In the FALSE condition, the user is prompted if a directory already exists and asked whether to overwrite it or not. The user is also given information about which files are being downloaded, extracted, deleted, and where they are being written to. The user is also notified if there is a newer version of the requested data package and given the option to download the newest version instead of the requested version. It also provides information about what errors (if any) were encountered and give suggestions on how to address them. A user may choose to set `force = TRUE`, especially when scripting or batch processing to minimize print statements to the console. When force is set to TRUE, all existing files are automatically overwritten without prompting. Feedback about which files are being downloaded and where is not reported. The user is not informed of newer versions of the requested data packages; only the exact reference specified is downloaded. If a reference ID corresponds to something that is not a data package, the contents will be downloaded anyway. Only critical errors that stop the function (such as failed API calls) generate warnings. Failed downloads (invalid reference ID, insufficient DataStore privileges) will result in an empty folder corresponding to that data package within the 'data' folder.} @@ -47,17 +47,17 @@ Although `get_data_packages()` is designed to handle the data package reference } \examples{ \dontrun{ -#get a public data package +# get a public data package get_data_packages(2300498, secure = FALSE) -#get a list of data packages, some public some restricted +# get a list of data packages, some public some restricted get_data_packages(c(2272461, 1234567, 7654321), secure = TRUE) -#pass a list of data packages to retrieve to the function: -data_packages<-c(2272461, 1234567, 7654321) -get_data_packages(data_packages, secure = TRUE, path="../../my_custom_directory") +# pass a list of data packages to retrieve to the function: +data_packages <- c(2272461, 1234567, 7654321) +get_data_packages(data_packages, secure = TRUE, path = "../../my_custom_directory") -#get a data package and return the path the data package is saved to +# get a data package and return the path the data package is saved to pathToDataForPiping <- get_data_packages(2272461, secure = TRUE, force = FALSE) } } From 3866597a14f6eb250e811da851b4b1a602b69524 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Tue, 25 Feb 2025 14:28:27 -0700 Subject: [PATCH 4/7] update to remove reference to specific software --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 591e99f..1a4aa16 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,7 +107,7 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/nation - Use a **clear and descriptive title** for the issue to identify the suggestion. - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. -- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. +- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. There is good free software for generating these GIFs across all major operating systems. - **Explain why this enhancement would be useful** to most users. You may also want to point out the other projects that solved it better and which could serve as inspiration. ### Your First Code Contribution From ee37799a5c1e834efe6816a621e11e71375a9767 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Tue, 25 Feb 2025 14:28:41 -0700 Subject: [PATCH 5/7] add notes about updating readme and contributing.md --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index b3cdbfd..690f9c7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,8 @@ # NPSutils 1.0.1 (development version) +## 2025-02-25 + * Update `CONTRIBUTING.md` + * Update readme to remove mention of "borked" functions + ## 2025-02-22 * Add `CONTRIBUTING.md` file. From c089f5f69465c38d0350913ffa7da6b77413a72c Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Tue, 25 Feb 2025 14:29:12 -0700 Subject: [PATCH 6/7] remove reference to 'borked' functions as they have all been unborked. --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 9eedbf8..c1e2ab7 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,6 @@ This package is a collection of functions to acquire metadata and data from the [National Park Service DataStore](https://irma.nps.gov/DataStore/). Please request enhancements and bug fixes through [Issues](https://github.com/nationalparkservice/NPSutils/issues). -These functions are under active development and we apologize for any -that are borked. - # Install from GitHub ``` r From 03c6d17fa7d40d0db94ca639a6081ef83549d9c5 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Tue, 25 Feb 2025 14:29:31 -0700 Subject: [PATCH 7/7] update via devtools::document and pkgown::build_site_github_pages --- docs/index.html | 1 - docs/news/index.html | 8 +++++++- docs/pkgdown.yml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/index.html b/docs/index.html index eda7af1..93a1071 100644 --- a/docs/index.html +++ b/docs/index.html @@ -52,7 +52,6 @@

    This package is a collection of functions to acquire metadata and data from the National Park Service DataStore. Please request enhancements and bug fixes through Issues.

    -

    These functions are under active development and we apologize for any that are borked.

    Install from GitHub diff --git a/docs/news/index.html b/docs/news/index.html index 7dea868..ebf0c33 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -36,7 +36,13 @@

    Changelog

    NPSutils 1.0.1 (development version)

    -

    2025-02-22

    +

    2025-02-25

    +
    • Update CONTRIBUTING.md +
    • +
    • Update readme to remove mention of “borked” functions
    • +
    +
    +

    2025-02-22

    • Add CONTRIBUTING.md file.
    diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 121dd3f..72ef30c 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.1.1 pkgdown_sha: ~ articles: NPSutils: NPSutils.html -last_built: 2025-02-21T23:49Z +last_built: 2025-02-25T21:27Z urls: reference: https://nationalparkservice.github.io/NPSutils/reference article: https://nationalparkservice.github.io/NPSutils/articles