diff --git a/.github/PULL_REQUEST_TEMPLATE/dev_pr.md b/.github/PULL_REQUEST_TEMPLATE/dev_pr.md
new file mode 100644
index 0000000..7a1155a
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE/dev_pr.md
@@ -0,0 +1,25 @@
+PRs into `dev` contained all necessary info. They have already been approved.
+Please provide the information below so `main` can be synced with `dev`:
+
+### List PRs
+
+List the PRs that were merged into `dev` that will be pulled into `main` and any issues they fix:
+
+* PR #? which fixes #?
+
+### Types of changes
+
+What types of changes does this pull request introduce? Put an `x` in the boxes that apply.
+This will inform the new release number.
+
+- [ ] Fix (non-breaking change which fixes a bug)
+- [ ] Feature (non-breaking change which adds or changes functionality)
+- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
+- [ ] Other change (if none of the other choices apply)
+
+### Reviewer instructions
+
+The underlying PRs should have been reviewed. Please check that the proposed merge is correct before approving.
+If any checkboxes other than "Other change" have been selected please prepare the following file changes for a new release version:
+- [ ] NEWS.md - add release notes
+- [ ] DESCRIPTION - increment the version number according to [Semantic Versioning](https://semver.org)
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..fae769f
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,36 @@
+Your commits explain the `who`, `what`, `where` and `when` of these changes. Your code shows the `how`. You do not need to reiterate this. This PR should complete the picture by explaining `why` these changes are necessary.
+Please complete the fields below, replacing or removing placeholder text where necessary:
+
+### Justification
+
+Please describe the importance/impact of the problem and a description of how the changes in this pull request will address, resolve or improve it. This section should sufficiently explain to reviewers why these changes should be approved.
+If the proposed changes should close an issue, be sure to link to it below:
+Fixes #?
+
+### Types of changes
+
+What types of changes does this pull request introduce? Put an `x` in the boxes that apply.
+This will inform the new release number.
+
+- [ ] Fix (non-breaking change which fixes a bug)
+- [ ] Feature (non-breaking change which adds or changes functionality)
+- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
+- [ ] Other change (if none of the other choices apply)
+
+### Further comments
+
+If this is a relatively large or complex change, kick off a discussion by explaining why you chose the solution you did, what alternatives you considered, problems you may have encountered, etc.
+
+### Reviewer instructions
+
+Assign at least 2 reviewers:
+* one of which should be a maintainer of this repo,
+* the others should be familiar with the subject or problem.
+
+Please detail the process reviewers will need to follow to properly test these changes. It is especially helpful to identify the exact code needed to conduct a local build/review/test and to specify any aspects of the testing that may not be obvious.
+
+### Formatting
+
+This repo contains an `air.toml` file that automatically formats code to a set of standards.
+It is preferred that contributors and reviewers install the [Air](https://posit-dev.github.io/air/) formatting tool.
+Code submitted in this pull request will be automatically checked for correct formatting.
diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml
index b6cac5a..31c9457 100644
--- a/.github/workflows/R-CMD-check.yaml
+++ b/.github/workflows/R-CMD-check.yaml
@@ -30,7 +30,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- uses: r-lib/actions/setup-pandoc@v2
diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml
new file mode 100644
index 0000000..9ba132d
--- /dev/null
+++ b/.github/workflows/format-check.yml
@@ -0,0 +1,24 @@
+# Workflow derived from https://github.com/posit-dev/setup-air/tree/main/examples
+
+on:
+ push:
+ branches: [main, dev]
+ pull_request:
+ workflow_dispatch:
+
+name: format-check.yaml
+
+permissions: read-all
+
+jobs:
+ format-check:
+ name: format-check
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+
+ - name: Install
+ uses: posit-dev/setup-air@v1
+
+ - name: Check
+ run: air format . --check
\ No newline at end of file
diff --git a/.github/workflows/format-suggest.yml b/.github/workflows/format-suggest.yml
new file mode 100644
index 0000000..63f7c02
--- /dev/null
+++ b/.github/workflows/format-suggest.yml
@@ -0,0 +1,31 @@
+# Workflow derived from https://github.com/posit-dev/setup-air/tree/main/examples
+
+on:
+ pull_request:
+
+name: format-suggest.yaml
+
+jobs:
+ format-suggest:
+ name: format-suggest
+ runs-on: ubuntu-latest
+
+ permissions:
+ # Required to push suggestion comments to the PR
+ pull-requests: write
+
+ steps:
+ - uses: actions/checkout@v6
+
+ - name: Install
+ uses: posit-dev/setup-air@v1
+
+ - name: Format
+ run: air format .
+
+ - name: Suggest
+ uses: reviewdog/action-suggester@v1
+ with:
+ level: error
+ fail_level: error
+ tool_name: air
diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml
index 7e43b39..5123a6f 100644
--- a/.github/workflows/pkgdown.yml
+++ b/.github/workflows/pkgdown.yml
@@ -11,7 +11,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v6
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
@@ -23,7 +23,7 @@ jobs:
shell: Rscript {0}
- name: Cache R packages
- uses: actions/cache@v3
+ uses: actions/cache@v5
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
diff --git a/.github/workflows/secretScan.yml b/.github/workflows/secretScan.yml
deleted file mode 100644
index 3fb5ca3..0000000
--- a/.github/workflows/secretScan.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: gitleaks
-
-on: [push,pull_request]
-
-jobs:
- gitleaks:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: '0'
- - name: gitleaks-action
- uses: gitleaks/gitleaks-action@v1.6.0
diff --git a/.github/workflows/update_mdat_data.yaml b/.github/workflows/update_mdat_data.yaml
new file mode 100644
index 0000000..4cb8719
--- /dev/null
+++ b/.github/workflows/update_mdat_data.yaml
@@ -0,0 +1,69 @@
+name: pull data from MDAT data hub
+
+on:
+ workflow_dispatch:
+ schedule:
+ # uses UTC/GMT time (+ 5 hrs)
+ ## put on HOLD temporarily
+ - cron: "0 17 * * 6" # Every Saturday at 1200 hrs = 1700 UTC
+
+
+jobs:
+
+ build:
+ runs-on: ubuntu-latest
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ permissions:
+ contents: write
+ pull-requests: write
+
+ steps:
+ - name: Checkout repo
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+
+ - name: Set up pandoc
+ uses: r-lib/actions/setup-pandoc@v2
+
+ - name: Set up R
+ uses: r-lib/actions/setup-r@v2
+ with:
+ r-version: '4.2.0'
+
+ - name: Install system dependencies
+ uses: r-lib/actions/setup-r-dependencies@v2
+
+ - name: Install command line packages
+ run: |
+ sudo apt update
+ sudo apt-get install libcurl4-openssl-dev libgit2-dev libudunits2-dev
+ shell: bash
+
+ - name: Install packages
+ run: |
+ install.packages(c("remotes","here","httr2","jsonlite","dplyr","glue"))
+ remotes::install_github("NEFSC/NEFSC-Spatial")
+ shell: Rscript {0}
+
+ - name: Pull MDAT data and save to repo
+ run: |
+ options(timeout = 60 * 60 * 6)
+ source(here::here("data-raw/get_mdat_for_package.R"))
+ get_mdat_for_package(overwrite = TRUE)
+ shell: Rscript {0}
+
+ # Create the Pull Request from dev if changes are detected
+ - name: Create Pull Request
+ uses: peter-evans/create-pull-request@v8.1.1
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ commit-message: "chore: update external data"
+ title: "Automated Data Update"
+ body: |
+ This is an automated pull request containing the latest fetched data.
+ Please review the changes before merging.
+ branch: automated-data-update
+ base: dev
+ delete-branch: false
diff --git a/.github/workflows/update_mdeb_data.yaml b/.github/workflows/update_mdeb_data.yaml
deleted file mode 100644
index dc07a84..0000000
--- a/.github/workflows/update_mdeb_data.yaml
+++ /dev/null
@@ -1,121 +0,0 @@
-name: pull data from MDEB data hub
-
-on:
- push:
- branches:
- - main2
- pull_request:
- branches:
- - main2
- #schedule:
- # uses UTC/GMT time (+ 5 hrs)
- ## put on HOLD temporarily
- #- cron: "0 17 * * 3" # Every Wednesday at 1200 hrs = 1700 UTC
-
-
-jobs:
-
- build:
- runs-on: ubuntu-latest
- env:
- GITHUB_PAT: ${{ secrets.GH_RELEASE }}
- R_REMOTES_NO_ERRORS_FROM_WARNINGS: false
-
- steps:
- - name: Checkout repo
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: set up pandoc
- uses: r-lib/actions/setup-pandoc@v2
-
- - name: Install command line packages
- run: |
- sudo apt update
- sudo apt-get install libcurl4-openssl-dev libgit2-dev
-# sudo apt-get install libgdal-dev libcurl4-gnutls-dev libgit2-dev libudunits2-dev libharfbuzz-dev libfribidi-dev
- shell: bash
-
- - name: Set up R
- uses: r-lib/actions/setup-r@v2
- with:
- r-version: '4.2.0'
-
- - name: Install packages
- run: |
- install.packages(c("remotes","jsonlite", "dplyr", "httr2", "here", "sf","rmarkdown"))
- remotes::install_github("NEFSC/NEFSC-Spatial")
- shell: Rscript {0}
-
- - name: Pull MDEB data and save to repo
- run: |
- options(timeout = 60 * 60 * 6)
- source(here::here("data-raw/get_mdeb_for_package.R"))
- get_mdeb_for_package()
- shell: Rscript {0}
-
- - name: Make Comparisons for commit
- # check for new data added or data omitted. Not concerned with data fixes
- # update NEWS.md, DESCRIPTION with version/notes
- # increments package version in description
- run: |
- options(timeout = 60 * 60 * 6)
- source(here::here("data-raw/compare_data.r"))
- source(here::here("data-raw/update_description.R"))
- source(here::here("data-raw/update_news.R"))
- diffs <- compare_data()
- version <- update_description(diffs, digit=3)
- update_news(version, diffs)
- rmarkdown::render(here::here("data-raw/sendAsEmail.Rmd"),
- params = diffs)
-
- saveRDS(version,here::here("data-raw/version.rds"))
- shell: Rscript {0}
-
- - name: render readme.rmd
- run: |
- options(timeout = 60 * 60 * 6)
- rmarkdown::render(here::here("README.Rmd"))
- shell: Rscript {0}
-
- # Send email indicating if anything has changed
- # - name: Send email
- # uses: dawidd6/action-send-mail@v3
- #
- # with:
- # server_address: smtp.gmail.com
- # server_port: 465
- #
- # username: ${{ secrets.MAIL_USERNAME }}
- # password: ${{ secrets.MAIL_PASSWORD }}
- #
- # subject: Github Actions job result
- # to: andrew.beet@noaa.gov
- #
- # from: NEFSCspatial GitHub
- #
- # #body: file://${{github.workspace}}/data-raw/datapull.txt
- #
- # html_body: file://${{github.workspace}}/data-raw/sendAsEmail.html
- #
- # #attachments: ./data-raw/sendAsEmail.html
- #
- # - name: commit data files
- # run: |
- # git config user.name github-actions
- # git config user.email github-actions@github.com
- # git add data/*
- # git add README.md
- # git add NEWS.md
- # git add DESCRIPTION
- # git commit -m "automated mdeb pull from update_mdeb_data yml"
- # git push
- #
- # - name: create gh-release
- # run: |
- # version <- readRDS(here::here("data-raw/version.rds"))
- # if(!is.null(version)){
- # usethis::use_github_release(publish = TRUE)
- # }
- # shell: Rscript {0}
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..e731ba0
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,68 @@
+# NOAA Fisheries Open Science Code of Conduct
+
+This code of conduct was developed and adapted from the Atom code of conduct in October 2021,
+and revised from NOAA-NMFS-Brand-Resources in June 2024
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+ advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported
+by contacting the project team. All complaints will be reviewed and investigated
+and will result in a response that is deemed necessary and appropriate to the
+circumstances. Further details of specific enforcement policies may be posted
+separately.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..ff054a1
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,162 @@
+# Contributing Guidelines
+
+*Pull requests, bug reports, and all other forms of contribution are welcomed and highly encouraged!*
+
+### Contents
+
+- [Code of Conduct](#book-code-of-conduct)
+- [Asking Questions](#paperclip-asking-questions)
+- [Acceptable Types](#whale-acceptable-types)
+- [Opening an Issue](#fishing_pole_and_fish-opening-an-issue)
+- [Bug Reports and Other Issues](#blowfish-bug-reports-and-other-issues)
+- [Feature Requests](#tropical_fish-feature-requests)
+- [Creating a Branch](#anchor-creating-a-branch)
+- [Writing Commit Messages](#memo-writing-commit-messages)
+- [Submitting Pull Requests](#fish_cake-submitting-pull-requests)
+- [Coding Style](#shark-coding-style)
+- [Certificate of Origin](#crab-certificate-of-origin)
+- [Credits](#pray-credits)
+
+> **This guide serves to set clear expectations for everyone involved with the project so that we can improve it together while also creating a welcoming space for everyone to participate. Following these guidelines will help ensure a positive experience for contributors and maintainers.**
+
+## :book: Code of Conduct
+
+Please review our [Code of Conduct](CODE_OF_CONDUCT.md). It is in effect at all times. We expect it to be honored by everyone who contributes to this project.
+
+## :paperclip: Asking Questions
+
+GitHub issues are not the appropriate place to debug your specific project, but should be reserved for filing bugs and feature requests. For general questions please use the Discussion section of the repository.
+
+## :whale: Acceptable Types
+
+Throughout this project, we use standard `types` to communicate more effectively. These types are used when labeling issues, creating branches, committing changes and naming pull requests. Please reference and use the `types` below when contributing to this project:
+
+- **fix:** Patch an unexpected or undesirable behavior
+
+- **build:** Add or modify build-related components (e.g. workflows, versioning, etc.)
+
+- **chore:** Maintenance of product or repository (e.g. gitignore, templates, etc.)
+
+- **docs:** Add or modify documentation
+
+- **feature:** Add or modify a feature or functionality
+
+- **refactor:** Rewrite or restructure code without altering behavior
+
+- **style:** Reformat code style without altering behavior
+
+- **test:** Add or modify tests
+
+All issues, branches, commits and pull requests should align with one of the above `types`. If you have questions or need assistance, please reach out to a maintainer.
+
+## :fishing_pole_and_fish: Opening an Issue
+
+Before [creating an issue](https://help.github.com/en/github/managing-your-work-on-github/creating-an-issue), check that you are using the latest version of the project. If you are not up-to-date, see if updating fixes your issue first.
+
+### :blowfish: Bug Reports and Other Issues
+
+A great way to contribute to the project is to send a detailed issue when you encounter a problem.
+This repo has a 'Bug Report' issue template that will guide you in submitting a well-written, thorough bug report. If possible, please also create a [reprex](https://reprex.tidyverse.org/) and include it in your issue. This helps us quickly identify and fix the problem.
+
+When opening an issue, please follow these guidelines:
+
+- **Review the documentation** before opening a new issue.
+
+- **Be specific.** Describe the problem in detail. What did you expect to happen? What actually happened? What were you doing when the problem occurred? What version of the library are you using? What version of the OS are you running?
+
+- **Provide a reproducible example (e.g. [reprex](https://reprex.tidyverse.org/))** If possible, provide a minimal, complete, and verifiable example that reproduces the issue. This is often the most important part of a bug report. If you can provide a sample project that reproduces the issue, that is even better!
+
+- **Prefer using [reactions](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)**, not comments, if you simply want to "+1" an existing issue.
+
+- **Use [GitHub-flavored Markdown](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).** Especially put code blocks and console outputs in backticks (```). This improves readability. In short, since you are most likely a developer, **provide a ticket that you would like to receive**.
+
+- **Do not open a duplicate issue!** Search through existing issues to see if your issue has previously been reported. If your issue exists, comment with any additional information you have. You may simply leave a reaction to bump the issue, which helps prioritize the most common problems and requests.
+
+- **Fully complete the provided issue template.** The bug report template requests all the information we need to quickly and efficiently address your issue. Be clear, concise, and descriptive. Provide as much information as you can, including steps to reproduce, stack traces, compiler errors, library versions, OS versions, and screenshots (if applicable).
+
+### :tropical_fish: Feature Requests
+
+Feature requests are more than welcome! While we will consider all requests, we cannot guarantee your request will be accepted or provide the timeline for implementation and release.
+
+- **Do not open a duplicate feature request.** Search for existing feature requests first. If you find your feature (or one very similar) previously requested, comment on or add a reaction to that issue.
+
+- **Fully complete the provided issue template.** The 'Feature Request' template asks for all necessary information for us to begin a productive conversation.
+
+- **Be precise** about the proposed outcome of the feature and how it relates to existing features. Include all implementation details.
+
+## :anchor: Creating a Branch
+
+Many contributions to this project will make use of [branching](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches). This repo has two permanent branches: `main` and `dev`. To contribute via branching, you should create a branch from and pull request to the `dev` branch. Your branch name should follow these conventions:
+
+- Use `type/i#-describe-branch-purpose`, where # is the number of the target issue
+- Prefix with the `type` of change the branch will introduce (see [acceptable `types`](#whale-acceptable-types) above)
+- Include an issue number in your branch name (your changes should relate to an [existing issue](#fishing_pole_and_fish-opening-an-issue))
+- Provide a clear but concise description of the branch's purpose
+
+## :memo: Writing Commit Messages
+
+Please write a **conventional** commit message:
+
+1. Use `type(optional scope): commit message` structure (see above for [acceptable `types`](#whale-acceptable-types))
+1. Separate changes into their own commits with unique messages
+1. Write using imperative mood (example: "fix: correct the food web")
+1. Include a `scope` if a commit serves a larger purpose (example: "refactor(food web fix): reorder data ingestion")
+1. Be as brief as possible without losing clarity
+
+## :fish_cake: Submitting Pull Requests
+
+We appreciate pull requests! Before [forking the repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) and [creating a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/proposing-changes-to-your-work-with-pull-requests) for non-trivial changes, it is usually best to first open an issue to discuss the changes, or discuss your intended approach for solving the problem in the comments for an existing issue.
+
+*Note: All contributions will be licensed under the project's license.*
+
+**Guidelines for happy pull requests:**
+
+- **Title meaningfully.** Consistent with the convention elsewhere, please title your pull request: "Type(#i): Describe Change Purpose", where "i" is the number of the issue addressed by the PR. Please reference the [acceptable types](#whale-acceptable-types) above.
+
+- **Request appropriate reviewers.** At the very least, please request review from one or all of the project maintainers (maintainers are listed on the [README](README.md)). You should include additional reviews from people familiar with the subject or problem your proposed changes address.
+
+- **Communication is the key to success.** If you are unsure about something, ask! We are happy to help. We have an open channel of communication, make sure to reach out and further develop your ideas or changes before working on a pull request.
+
+- **Smaller is better.** Submit **one** pull request per bug fix or feature. A pull request should contain isolated changes pertaining to a single bug fix or feature implementation. **Do not** refactor or reformat code that is unrelated to your change. It is better to **submit many small pull requests** rather than a single large one. Enormous pull requests will take enormous amounts of time to review, or may be rejected altogether.
+
+- **Coordinate bigger changes.** For large and non-trivial changes, open an issue to discuss a strategy with the maintainers. Otherwise, you risk doing a lot of work for nothing!
+
+- **Prioritize understanding over cleverness.** Write code **clearly** and **concisely**, please supply comments when it is needed. Remember that source code usually gets written once and read often. Ensure the code is clear to the reader. The purpose and logic should be obvious to a reasonably skilled developer, otherwise you should add a comment that explains it.
+
+- **Follow the existing architecture.** If you are adding new functionality, try to follow the existing architecture and patterns in the code base. If you are unsure, ask for guidance.
+
+- **Include test coverage.** Add unit tests or UI tests when possible. Follow existing patterns for implementing tests.
+
+- **Update the example project** if one exists to exercise any new functionality you have added.
+
+- **Add documentation.** Document your changes with code comments or other documentation.
+
+- **Use the correct branch.** Branch from and [submit your pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) to the correct branch (see above for [branching instructions](#anchor-creating-a-branch)). In this repo, it will be the `dev` branch.
+
+- **[Resolve any merge conflicts](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-on-github)** that occur.
+
+## :shark: Coding Style
+
+Consistent formatting is an essential part of effective collaboration and communication. Reading, writing and reviewing code all benefit from following the standards and conventions of a project. Failure to do so will result in a prolonged review process that has to focus on updating the superficial aspects of your code, rather than improving its functionality and performance. This repo uses and adheres to the [tidyverse style guide](https://style.tidyverse.org/) and the [Air autoformatting tool](https://posit-dev.github.io/air/) that follows it. Please read and follow these guides as you make contributions to the project.
+`NEFSCspatial` is primarily a data package. All documentation of data objects should be added to the `R` folder with the name `data-[data-name].R` (using a hyphen). Any functions names should use snake_case
+
+## :crab: Certificate of Origin
+
+*Developer's Certificate of Origin 1.1*
+
+By making a contribution to this project, I certify that:
+
+> 1. The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
+> 1. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
+> 1. The contribution was provided directly to me by some other person who certified (1), (2) or (3) and I have not modified it.
+> 1. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
+
+## :fish: Thank You!
+
+If you are reading this, thank you! We appreciate your interest in contributing to this project.
+
+To confirm that you have read this guide and are following it as best as possible, **include this emoji at the top** of your issue or pull request: :fish: `:fish:`
+
+## :pray: Credits
+
+This document was inspired by [@jessesquires](https://github.com/jessesquires).
diff --git a/DESCRIPTION b/DESCRIPTION
index 3e362ca..3657f57 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Package: NEFSCspatial
Title: Spatial data package for regions in the northeast atlantic
-Version: 0.1.0
+Version: 1.0.0
Authors@R: c(person("Andy", "Beet", email = "andrew.beet@noaa.gov", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8270-7090")),
person("Joshua", "Hatch", email = "joshua.hatch@noaa.gov", role = "aut"),
person("Kimberly", "Bastille", email = "kimberly.bastille@noaa.gov", role = "aut"))
@@ -10,7 +10,6 @@ Description: Provides spatial data as sf or raster objects for the Northeast Fis
License: file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
-RoxygenNote: 7.3.2
Depends:
R (>= 4.0)
Imports:
@@ -36,3 +35,4 @@ Suggests:
LazyData: true
LazyDataCompression: bzip2
VignetteBuilder: knitr
+Config/roxygen2/version: 8.1.0
diff --git a/NEWS.md b/NEWS.md
index a894f64..fe13ee3 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,8 +1,30 @@
+# NEFSCspatial 1.0.0
+
+## Major changes
+
+The following data were deprecated and replaced:
+
+* BTS_Strata -> bts_strata
+* Ecomon_Strata -> ecomon_strata
+* Shrimp_Strata -> shrimp_strata
+* Shellfish_Strata -> oq_strata, sc_strata, scallop_strata
+
+The following data were added:
+
+* ecomon_stations
+
+# NEFSCspatial 0.1.1
+
+## Minor fixes
+
+- Migrated to Bootstrap 5
+- Updated Team Members vignette
+
# NEFSCspatial 0.1.0
## Data set additions/removals
-- Data sets from [MDEB](Marine Development GIS Data Hub) data hub (Marine Development GIS Data Hub)
+- Data sets from [MDEB](https://mdeb-nefsc-noaa.hub.arcgis.com/) data hub (Marine Development GIS Data Hub)
- Scallop restricted areas
- Massachusetts inshore survey strata
- Deprecation warnings for data sets due to be replaced by MDEB data
@@ -13,7 +35,6 @@
- Removed leaflet documentation
- Standardized data set documentation with added examples
-
# NEFSCspatial 0.0.1
Initial release of sf objects
diff --git a/R/data-bts_strata.R b/R/data-bts_strata.R
new file mode 100644
index 0000000..8d19318
--- /dev/null
+++ b/R/data-bts_strata.R
@@ -0,0 +1,28 @@
+#' Bottom Trawl Survey
+#'
+#' @description An \code{sf} object containing spatial data for the Bottom Trawl Survey. Scientific survey strata for the Bottom Trawl Survey.
+#'
+#' @format An \code{sf} object:
+#' \describe{
+#' \item{Geometry type}{POLYGON}
+#' \item{Dimension}{XY}
+#' \item{Bounding box}{xmin: -76.2 ymin: 34.4 xmax: -65.6 ymax: 44.5}
+#' \item{Projected CRS}{WGS 84}
+#' \item{Features}{82 x 16}
+#' \item{Metadata}{See source}
+#' }
+#'
+#' @docType data
+#' @name bts_strata
+#' @usage data('bts_strata')
+#' @keywords {datasets}
+#' @source {https://mdeb-nefsc-noaa.hub.arcgis.com/}
+#' @examples
+#' \dontrun{
+#' # Load the dataset
+#' data(bts_strata)
+#'
+#' # Plot the geometry
+#' plot(sf::st_geometry(bts_strata))
+#' }
+NULL
diff --git a/R/data-ecomon_stations.R b/R/data-ecomon_stations.R
new file mode 100644
index 0000000..6cbc0f0
--- /dev/null
+++ b/R/data-ecomon_stations.R
@@ -0,0 +1,28 @@
+#' Ecosystem Monitoring Survey
+#'
+#' @description An \code{sf} object containing spatial data for the Ecosystem Monitoring Survey. There are thirty-five Ecosystem Monitoring fixed hydrographic sampling stations across the Northeast Shelf ecosystem. Four transects run from inshore to off the continental shelf from north of Cape Hatteras to Cape Cod. One transect bisects the Gulf of Maine from the coast of Maine and across Georges Bank. The remaining twelve stations in the Gulf of Maine sample deep basins, banks, coastal areas, and the inflow (Northeast Channel) and out flow (Great South Channel) of the gulf.
+#'
+#' @format An \code{sf} object:
+#' \describe{
+#' \item{Geometry type}{POINT}
+#' \item{Dimension}{NA}
+#' \item{Bounding box}{xmin: -75.5 ymin: 36 xmax: -65.4 ymax: 44.5}
+#' \item{Projected CRS}{WGS 84}
+#' \item{Features}{35 x 14}
+#' \item{Metadata}{See source}
+#' }
+#'
+#' @docType data
+#' @name ecomon_stations
+#' @usage data('ecomon_stations')
+#' @keywords {datasets}
+#' @source {https://mdeb-nefsc-noaa.hub.arcgis.com/}
+#' @examples
+#' \dontrun{
+#' # Load the dataset
+#' data(ecomon_stations)
+#'
+#' # Plot the geometry
+#' plot(sf::st_geometry(ecomon_stations))
+#' }
+NULL
diff --git a/R/data-ecomon_strata.R b/R/data-ecomon_strata.R
new file mode 100644
index 0000000..b1c422c
--- /dev/null
+++ b/R/data-ecomon_strata.R
@@ -0,0 +1,28 @@
+#' Ecosystem Monitoring Survey
+#'
+#' @description An \code{sf} object containing spatial data for the Ecosystem Monitoring Survey. Ecosystem Monitoring plankton stations are selected using a random-stratified design based on the Northeast Fisheries Science Center bottom trawl survey design. There are forty-seven plankton strata across the Northeast Shelf ecosystem. The strata are combined into four regions from Cape Hatteras to Cape Sable (Mid-Atlantic Bight, Southern New England, Georges Bank, and Gulf of Maine). Thirty randomly selected stations are targeted for sampling from each region during a survey.
+#'
+#' @format An \code{sf} object:
+#' \describe{
+#' \item{Geometry type}{MULTIPOLYGON}
+#' \item{Dimension}{XY}
+#' \item{Bounding box}{xmin: -76 ymin: 35.1 xmax: -65.2 ymax: 44.5}
+#' \item{Projected CRS}{WGS 84}
+#' \item{Features}{48 x 13}
+#' \item{Metadata}{See source}
+#' }
+#'
+#' @docType data
+#' @name ecomon_strata
+#' @usage data('ecomon_strata')
+#' @keywords {datasets}
+#' @source {https://mdeb-nefsc-noaa.hub.arcgis.com/}
+#' @examples
+#' \dontrun{
+#' # Load the dataset
+#' data(ecomon_strata)
+#'
+#' # Plot the geometry
+#' plot(sf::st_geometry(ecomon_strata))
+#' }
+NULL
diff --git a/R/data-shrimp_strata.R b/R/data-shrimp_strata.R
new file mode 100644
index 0000000..9eed037
--- /dev/null
+++ b/R/data-shrimp_strata.R
@@ -0,0 +1,28 @@
+#' Northern Shrimp Survey
+#'
+#' @description An \code{sf} object containing spatial data for the Northern Shrimp Survey. Scientific survey strata for the Northern Shrimp Survey.
+#'
+#' @format An \code{sf} object:
+#' \describe{
+#' \item{Geometry type}{POLYGON}
+#' \item{Dimension}{XY}
+#' \item{Bounding box}{xmin: -70.7 ymin: 41.1 xmax: -68 ymax: 44.1}
+#' \item{Projected CRS}{WGS 84}
+#' \item{Features}{12 x 9}
+#' \item{Metadata}{See source}
+#' }
+#'
+#' @docType data
+#' @name shrimp_strata
+#' @usage data('shrimp_strata')
+#' @keywords {datasets}
+#' @source {https://mdeb-nefsc-noaa.hub.arcgis.com/}
+#' @examples
+#' \dontrun{
+#' # Load the dataset
+#' data(shrimp_strata)
+#'
+#' # Plot the geometry
+#' plot(sf::st_geometry(shrimp_strata))
+#' }
+NULL
diff --git a/R/data_BTS_strata.R b/R/data_BTS_strata.R
deleted file mode 100644
index 5dbc7a9..0000000
--- a/R/data_BTS_strata.R
+++ /dev/null
@@ -1,25 +0,0 @@
-#' `r lifecycle::badge("deprecated")`
-#'
-#' NEFSC Bottom Trawl Survey Strata
-#'
-#' An \code{sf} object containing the boundaries of the NEFSC bottom trawl survey strata.
-#' This set of strata is considered historical. (Pre 2000).
-#'
-#' @format An \code{sf} object:
-#' \describe{
-#' \item{Geometry type}{POLYGON}
-#' \item{dimension}{XY}
-#' \item{Bounding box}{xmin: -79.18422 ymin: 32.50221 xmax: -65.16869 ymax: 44.83202}
-#' \item{Geodetic CRS}{NAD 83}
-#' \item{Features}{185 x 10}
-#' \item{Metadata}{See source}
-#' }
-#'
-#' @docType data
-#' @name BTS_Strata
-#' @usage data("BTS_Strata")
-#' @keywords datasets
-#' @source \url{https://drive.google.com/drive/folders/15s70lDwezatlNVReDMWRJadtlklMYSnC}
-#' @source \url{https://www.fisheries.noaa.gov/inport/item/33471}
-#' @note Use \url{https://mdeb-nefsc-noaa.hub.arcgis.com/datasets/noaa::bottom-trawl-survey/about} instead.
-NULL
diff --git a/R/data_EcoMon_Strata.R b/R/data_EcoMon_Strata.R
deleted file mode 100644
index ef3c0d5..0000000
--- a/R/data_EcoMon_Strata.R
+++ /dev/null
@@ -1,24 +0,0 @@
-#' `r lifecycle::badge("deprecated")`
-#'
-#' Ecosystem Monitoring Cruise (EcoMon) strata
-#'
-#' An sf object containing the EcoMon strata
-#'
-#' @format A data frame/ \code{sf} object
-#' \describe{
-#' \item{Geometry type}{POLYGON}
-#' \item{Dimension}{XY}
-#' \item{Bounding box}{xmin: -75.96791 ymin: 35.14219 xmax: -65.16869 ymax: 44.48558}
-#' \item{Geodetic CRS}{NAD83}
-#' \item{Features}{47 x 4}
-#' \item{Metadata}{See source}
-#' }
-#'
-#'
-#' @docType data
-#' @name EcoMon_Strata
-#' @usage data("EcoMon_Strata")
-#' @keywords datasets
-#' @source \url{https://www.fisheries.noaa.gov/inport/item/33468}
-#' @note Use \url{https://mdeb-nefsc-noaa.hub.arcgis.com/datasets/noaa::ecosystem-monitoring-survey/about} instead.
-NULL
diff --git a/R/data_Shellfish_strata.R b/R/data_Shellfish_strata.R
deleted file mode 100644
index 4d283e9..0000000
--- a/R/data_Shellfish_strata.R
+++ /dev/null
@@ -1,24 +0,0 @@
-#' `r lifecycle::badge("deprecated")`
-#'
-#' Shellfish strata (Clam and Scallop surveys)
-#'
-#' An sf object containing the Clam and Scallop survey strata
-#'
-#' @format A data frame/ \code{sf} object
-#' \describe{
-#' \item{Geometry type}{POLYGON}
-#' \item{Dimension}{XY}
-#' \item{Bounding box}{xmin: -75.95982 ymin: 35.50142 xmax: -65.89944 ymax: 42.16817}
-#' \item{Geodetic CRS}{NAD83}
-#' \item{Features}{97 x 10}
-#' \item{Metadata}{See source}
-#' }
-#'
-#'
-#' @docType data
-#' @name Shellfish_Strata
-#' @usage data("Shellfish_Strata")
-#' @keywords datasets
-#' @source \url{https://www.fisheries.noaa.gov/inport/item/33466}
-#' @note Use \url{https://mdeb-nefsc-noaa.hub.arcgis.com/maps/noaa::atlantic-surfclam-and-ocean-quahog-survey/about} or \url{https://mdeb-nefsc-noaa.hub.arcgis.com/maps/noaa::sea-scallop-survey/about} instead.
-NULL
diff --git a/R/data_Shrimp_strata.R b/R/data_Shrimp_strata.R
deleted file mode 100644
index 49845bc..0000000
--- a/R/data_Shrimp_strata.R
+++ /dev/null
@@ -1,24 +0,0 @@
-#' `r lifecycle::badge("deprecated")`
-#'
-#' Shrimp survey strata
-#'
-#' An sf object containing the Shrimp survey strata
-#'
-#' @format A data frame/ \code{sf} object
-#' \describe{
-#' \item{Geometry type}{POLYGON}
-#' \item{Dimension}{XY}
-#' \item{Bounding box}{xmin: -70.68152 ymin: 41.08476 xmax: -67.99941 ymax: 44.08762}
-#' \item{Geodetic CRS}{NAD83}
-#' \item{Features}{12 x 5}
-#' \item{Metadata}{See source}
-#' }
-#'
-#'
-#' @docType data
-#' @name Shrimp_Strata
-#' @usage data("Shrimp_Strata")
-#' @keywords datasets
-#' @source \url{https://www.fisheries.noaa.gov/inport/item/33470}
-#' @note Use \url{https://mdeb-nefsc-noaa.hub.arcgis.com/datasets/noaa::northern-shrimp-survey/about} instead.
-NULL
diff --git a/R/data_amapps_grid.R b/R/data_amapps_grid.R
index bd9b2a3..33a6c3e 100644
--- a/R/data_amapps_grid.R
+++ b/R/data_amapps_grid.R
@@ -1,7 +1,7 @@
#' @title AMAPPS 10 km Grid
#'
-#' @description An \code{sf} object containing the Atlantic Marine Assessment Program for Protected Species (AMAPPS) 10 km grid.
-#' The AMAPPS grid has a cell size of 10 km x 10 km, with an oblique Mercator projection.
+#' @description An \code{sf} object containing the Atlantic Marine Assessment Program for Protected Species (AMAPPS) 10 km grid.
+#' The AMAPPS grid has a cell size of 10 km x 10 km, with an oblique Mercator projection.
#' Grid cell values represent grid cell IDs.
#'
#' @format An \code{sf} object:
@@ -23,18 +23,17 @@
#' \dontrun{
#' # load terra
#' library(terra)
-#'
+#'
#' # convert sf to SpatVector
-#' amapps_vec <- NEFSCspatial::amapps_grid |> as('SpatVector')
-#'
+#' amapps_vec <- NEFSCspatial::amapps_grid |> as('SpatVector')
+#'
#' # empty raster from amapps_vec
#' amapps_ras <- rast(amapps_vec, nrow = 328, ncol = 240)
-#'
+#'
#' # rasterize
#' amapps <- rasterize(amapps_vec, amapps_ras, field = 'AMAPPS_10km_grid')
-#'
+#'
#' # visualize
#' plot(amapps)
#' }
NULL
-
diff --git a/R/zzz.R b/R/zzz.R
deleted file mode 100644
index 7be60d4..0000000
--- a/R/zzz.R
+++ /dev/null
@@ -1,19 +0,0 @@
-## Issue deprecation warning
-.onAttach <- function(libname, pkgname) {
- packageStartupMessage(
- paste(
- "Note: The following datasets are deprecated and will be removed in a future version:",
- " • BTS_Strata",
- " • EcoMon_Strata",
- " • Shellfish_Strata",
- " • Shrimp_Strata",
- "Please use https://mdeb-nefsc-noaa.hub.arcgis.com/datasets instead:",
- " +/noaa::bottom-trawl-survey/about",
- " +/noaa::ecosystem-monitoring-survey/about",
- " +/noaa::atlantic-surfclam-and-ocean-quahog-survey/about",
- " +/noaa::sea-scallop-survey/about",
- " +/noaa::northern-shrimp-survey/about",
- sep = "\n"
- )
- )
-}
diff --git a/README.md b/README.md
index 3fad141..c7e3cf5 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,5 @@
# NEFSCspatial
-[](https://github.com/NEFSC/NEFSC-Spatial/actions/workflows/secretScan.yml)
[](https://github.com/NEFSC/NEFSC-Spatial/actions/workflows/pkgdown.yml)
[](https://github.com/NEFSC/NEFSC-Spatial/actions/workflows/R-CMD-check.yaml)
@@ -20,4 +19,4 @@ This repository is a scientific product and is not official communication of the
-[U.S. Department of Commerce](https://www.commerce.gov/) | [National Oceanographic and Atmospheric Administration](https://www.noaa.gov) | [NOAA Fisheries](https://www.fisheries.noaa.gov/) | [NEFSC](https://www.fisheries.noaa.gov/about/northeast-fisheries-science-center)
+[U.S. Department of Commerce](https://www.commerce.gov/) | [NOAA](https://www.noaa.gov) | [NOAA Fisheries](https://www.fisheries.noaa.gov/) | [NEFSC](https://www.fisheries.noaa.gov/about/northeast-fisheries-science-center)
diff --git a/air.toml b/air.toml
new file mode 100644
index 0000000..e69de29
diff --git a/data-raw/create_hexsticker.R b/data-raw/create_hexsticker.R
index e234b82..4bf2acb 100644
--- a/data-raw/create_hexsticker.R
+++ b/data-raw/create_hexsticker.R
@@ -4,40 +4,57 @@ library(hexSticker)
library(ggimage)
### Option 1
-img1<- ggimage::image_read2(here::here("data-raw/images/hexstickerV1_ppt.PNG"))
-res1<- img1 %>%
+img1 <- ggimage::image_read2(here::here("data-raw/images/hexstickerV1_ppt.PNG"))
+res1 <- img1 %>%
#image_convert("png") %>%
- magick::image_resize("1080 x 600")#%>%
- #magick::image_fill(color="#062047", point="+45") %>%
- #magick::image_annotate("NEFSCspatial", size=38, location = "-10+100", color="black")
+ magick::image_resize("1080 x 600") #%>%
+#magick::image_fill(color="#062047", point="+45") %>%
+#magick::image_annotate("NEFSCspatial", size=38, location = "-10+100", color="black")
-res_final1<- hexSticker::sticker(res1, package = "NEFSCspatial", p_size = 16,
- p_y = 0.45, p_color = "#003087",
- s_x = 1, s_y=1.2, s_width = 1.5,
- s_height = 14, h_fill = "white", h_color="#003087",
- u_x = 0.18,
- u_y=1.47,
- url = "nefsc.github.io/NEFSCspatial",
- u_size = 5.8,
- filename = here::here("man/NEFSCspatial_hexsticker_v1.png"))
- #filename = here::here("man/figures/logo.png"))
+res_final1 <- hexSticker::sticker(
+ res1,
+ package = "NEFSCspatial",
+ p_size = 16,
+ p_y = 0.45,
+ p_color = "#003087",
+ s_x = 1,
+ s_y = 1.2,
+ s_width = 1.5,
+ s_height = 14,
+ h_fill = "white",
+ h_color = "#003087",
+ u_x = 0.18,
+ u_y = 1.47,
+ url = "nefsc.github.io/NEFSCspatial",
+ u_size = 5.8,
+ filename = here::here("man/NEFSCspatial_hexsticker_v1.png")
+)
+#filename = here::here("man/figures/logo.png"))
### Option 2
-img2<- ggimage::image_read2(here::here("data-raw/images/hexstickerV2_ppt.PNG"))
-res2<- img2 %>%
+img2 <- ggimage::image_read2(here::here("data-raw/images/hexstickerV2_ppt.PNG"))
+res2 <- img2 %>%
#image_convert("png") %>%
- magick::image_resize("1080 x 600")#%>%
+ magick::image_resize("1080 x 600") #%>%
#magick::image_fill(color="#062047", point="+45") %>%
#magick::image_annotate("NEFSCspatial", size=38, location = "-10+100", color="black")
-res_final2<- hexSticker::sticker(res2, package = "NEFSCspatial", p_size = 16,
- p_y = 0.65, p_color = "#003087",
- s_x = 0.95, s_y=1.05, s_width = 1.2,
- s_height = 12, h_fill = "white", h_color="#003087",
- u_x = 1.02,
- u_y=.07,
- url = "github.io/NEFSCspatial",
- u_size = 5.8,
- filename = here::here("data-raw/NEFSCspatial_hexsticker_v2.png"))
- #filename = here::here("man/figures/logo.png"))
-
+res_final2 <- hexSticker::sticker(
+ res2,
+ package = "NEFSCspatial",
+ p_size = 16,
+ p_y = 0.65,
+ p_color = "#003087",
+ s_x = 0.95,
+ s_y = 1.05,
+ s_width = 1.2,
+ s_height = 12,
+ h_fill = "white",
+ h_color = "#003087",
+ u_x = 1.02,
+ u_y = .07,
+ url = "github.io/NEFSCspatial",
+ u_size = 5.8,
+ filename = here::here("data-raw/NEFSCspatial_hexsticker_v2.png")
+)
+#filename = here::here("man/figures/logo.png"))
diff --git a/data-raw/create_sf_data_from_ftp.R b/data-raw/create_sf_data_from_ftp.R
index 362986d..9bd177b 100644
--- a/data-raw/create_sf_data_from_ftp.R
+++ b/data-raw/create_sf_data_from_ftp.R
@@ -15,13 +15,16 @@
#'
library(magrittr)
-source(here::here("data-raw","list_files_ftp.r"))
+source(here::here("data-raw", "list_files_ftp.r"))
# list files found on ftp site
ftpsite <- "ftp://ftp.nefsc.noaa.gov/pub/gis"
#fileList <- NEFSCspatial::list_files_ftp(ftpsite)
-create_sf_data_from_ftp <- function(ftpsite,file = NULL,tempDir=here::here("data-raw/temp")) {
-
+create_sf_data_from_ftp <- function(
+ ftpsite,
+ file = NULL,
+ tempDir = here::here("data-raw/temp")
+) {
# create temp dir if not already present
if (!dir.exists(tempDir)) {
dir.create(tempDir)
@@ -37,43 +40,39 @@ create_sf_data_from_ftp <- function(ftpsite,file = NULL,tempDir=here::here("data
allFiles <- list_files_ftp(ftpsite)
# filter shape files
- shpFiles <- grep("shp$",allFiles,value=T)
+ shpFiles <- grep("shp$", allFiles, value = T)
if (is.null(file)) {
# process all files
} else {
- isPresent <- grepl(file,shpFiles)
+ isPresent <- grepl(file, shpFiles)
if (any(isPresent)) {
# process single file
shpFiles <- shpFiles[isPresent]
} else {
- stop(paste0("Shapefile: ",file, " doesnt seem to be on the ftp server"))
+ stop(paste0("Shapefile: ", file, " doesnt seem to be on the ftp server"))
}
}
-
# now create sf object for each shpfile
# first find all files associated with shapefile, download, then make sf
- for (afile in shpFiles){
- shp <- tail(unlist(strsplit(afile,split = "\\/")),1)
- fstr <- gsub(".shp","",shp)
- message(paste0("Processing files related to = ",shp))
+ for (afile in shpFiles) {
+ shp <- tail(unlist(strsplit(afile, split = "\\/")), 1)
+ fstr <- gsub(".shp", "", shp)
+ message(paste0("Processing files related to = ", shp))
# select all files to download for this shapefile
- filesToDownload <- allFiles[grepl(fstr,allFiles)]
+ filesToDownload <- allFiles[grepl(fstr, allFiles)]
for (ashp in filesToDownload) {
- ashpfile <- gsub(paste0(ftpsite,"/"),"",ashp)
- curl::curl_download(ashp,destfile = paste0(tempDir,"/",ashpfile))
+ ashpfile <- gsub(paste0(ftpsite, "/"), "", ashp)
+ curl::curl_download(ashp, destfile = paste0(tempDir, "/", ashpfile))
}
- layer <- sf::st_read(dsn=paste0(tempDir,"/",shp))
+ layer <- sf::st_read(dsn = paste0(tempDir, "/", shp))
- centroids <- sf::st_coordinates(sf::st_centroid(layer))
- layer <- cbind(layer,centroids)
+ centroids <- sf::st_coordinates(sf::st_centroid(layer))
+ layer <- cbind(layer, centroids)
- assign(fstr,layer)
+ assign(fstr, layer)
do.call(myfun, list(as.name(fstr), overwrite = TRUE))
-
}
-
-
}
diff --git a/data-raw/create_sf_data_from_url.R b/data-raw/create_sf_data_from_url.R
index 27ce504..91b20d6 100644
--- a/data-raw/create_sf_data_from_url.R
+++ b/data-raw/create_sf_data_from_url.R
@@ -18,62 +18,61 @@ library(magrittr)
##options(warn=0)
create_sf_data_from_url <- function(url) {
-
# set up function for use in do.call
myfun <- get("use_data", asNamespace("usethis"))
- # get zip file, catch error for missing file
- result <- tryCatch(
- {
- message("Grabbing file: from ",url)
- temp <- base::tempfile()
- download.file(url=url,destfile=temp, quiet=TRUE)
- res <- TRUE
- },
- error = function(e){
- message(e)
- return(FALSE)
- } ,
- warning = function(w){
- return(FALSE)
- }
- )
-
- if (!result) { # failed to download file
- message(paste0("File ",url, " can not be downloaded. Please check the url and try again"))
- base::unlink(temp)
- next
- }
-
-
-
- # find names of all files in zip file
- filesInZip <- unzip(temp,list=T)
- temp2 <- base::tempfile()
- #unzip all files to a temporary directory
- unzip(zipfile = temp, exdir = temp2)
-
- # pick out all .shp files and their dir struct
- for (ifile in 1:nrow(filesInZip)) {
- afile <- filesInZip$Name[ifile]
- if (grepl("shp$",afile)) {
- ## read in shp file , create sf object, and export to data folder
- message(paste0("Shapefile = ",afile))
- exportName <- tail(unlist(strsplit(afile,"/")),1)
- exportName <- head(unlist(strsplit(exportName,"\\.")),1)
- ## replace any hyphens with underscores, hyphens can cause issues
- exportName <- gsub('-', '_',exportName)
- layer <- sf::st_read(dsn=paste0(temp2,"/",afile),quiet=T)
- centroids <- sf::st_coordinates(sf::st_centroid(layer))
- layer <- cbind(layer,centroids)
- assign(exportName,layer)
- do.call(myfun, list(as.name(exportName), overwrite = TRUE))
- }
+ # get zip file, catch error for missing file
+ result <- tryCatch(
+ {
+ message("Grabbing file: from ", url)
+ temp <- base::tempfile()
+ download.file(url = url, destfile = temp, quiet = TRUE)
+ res <- TRUE
+ },
+ error = function(e) {
+ message(e)
+ return(FALSE)
+ },
+ warning = function(w) {
+ return(FALSE)
+ }
+ )
- }
+ if (!result) {
+ # failed to download file
+ message(paste0(
+ "File ",
+ url,
+ " can not be downloaded. Please check the url and try again"
+ ))
+ base::unlink(temp)
+ next
+ }
- base::unlink(temp)
- base::unlink(temp2)
+ # find names of all files in zip file
+ filesInZip <- unzip(temp, list = T)
+ temp2 <- base::tempfile()
+ #unzip all files to a temporary directory
+ unzip(zipfile = temp, exdir = temp2)
+ # pick out all .shp files and their dir struct
+ for (ifile in 1:nrow(filesInZip)) {
+ afile <- filesInZip$Name[ifile]
+ if (grepl("shp$", afile)) {
+ ## read in shp file , create sf object, and export to data folder
+ message(paste0("Shapefile = ", afile))
+ exportName <- tail(unlist(strsplit(afile, "/")), 1)
+ exportName <- head(unlist(strsplit(exportName, "\\.")), 1)
+ ## replace any hyphens with underscores, hyphens can cause issues
+ exportName <- gsub('-', '_', exportName)
+ layer <- sf::st_read(dsn = paste0(temp2, "/", afile), quiet = T)
+ centroids <- sf::st_coordinates(sf::st_centroid(layer))
+ layer <- cbind(layer, centroids)
+ assign(exportName, layer)
+ do.call(myfun, list(as.name(exportName), overwrite = TRUE))
+ }
+ }
+ base::unlink(temp)
+ base::unlink(temp2)
}
diff --git a/data-raw/find_mdeb_data.R b/data-raw/find_mdat_data.R
similarity index 71%
rename from data-raw/find_mdeb_data.R
rename to data-raw/find_mdat_data.R
index 4e3292e..059149a 100644
--- a/data-raw/find_mdeb_data.R
+++ b/data-raw/find_mdat_data.R
@@ -1,33 +1,33 @@
-#' Find available data hosted on the MDEB (Marine Development and Ecology Branch) GIS Data Hub
-#' hosted on NOAA's Geoplatform
+#' Find available data hosted on the MDAT (Marine Development and Advanced Technology Program) GIS Data Hub
+#' hosted on NOAA's GeoPlatform
#'
#' @description
#' This function retrieves the data available on the
-#' \href{https://mdeb-nefsc-noaa.hub.arcgis.com/}{MDEB GIS Data Hub}.
+#' \href{https://mdeb-nefsc-noaa.hub.arcgis.com/}{MDAT GIS Data Hub}.
#'
#' @return A tibble with the following columns:
-#' \item{title}{Name of the NOAA Geoplatform feature service}
+#' \item{title}{Name of the NOAA GeoPlatform feature service}
#' \item{name}{Name of the hosted feature layer in the feature service}
#' \item{id}{Feature layer ID, a unique identifier assigned to layers within a feature service}
-#' \item{url}{URL of the NOAA Geoplatform feature layer}
+#' \item{url}{URL of the NOAA GeoPlatform feature layer}
#'
#' @examples
#' # Retrieve a list of available data
-#' mdeb_data <- find_mdeb_data()
-#' mdeb_data
+#' mdat_data <- find_mdat_data()
+#' mdat_data
#'
#' @export
-find_mdeb_data <- function() {
- # url of the MDEB GIS Data Hub search API
- mdeb_hub = "https://mdeb-nefsc-noaa.hub.arcgis.com/api/search/v1/collections/all/items"
+find_mdat_data <- function() {
+ # url of the MDAT GIS Data Hub search API
+ mdat_hub <- "https://mdeb-nefsc-noaa.hub.arcgis.com/api/search/v1/collections/all/items"
# scrape json to get all feature services
- catalog_items <- mdeb_hub |>
+ catalog_items <- mdat_hub |>
jsonlite::fromJSON()
# count the number of available services
num_items <- catalog_items$numberMatched
# pull all feature service items (API default = 10)
- catalog_items_v2 <- paste0(mdeb_hub, "?limit=", num_items) |>
+ catalog_items_v2 <- paste0(mdat_hub, "?limit=", num_items) |>
jsonlite::fromJSON()
# extract metadata properties
available_datasets <- catalog_items_v2$features$properties |>
@@ -46,7 +46,7 @@ find_mdeb_data <- function() {
wp <- dataset_json_url |>
jsonlite::fromJSON()
# create tibble for output
- av = wp$layers |>
+ av <- wp$layers |>
dplyr::mutate(dataset_url) |>
dplyr::mutate(url = paste0(url, '/', id)) |>
dplyr::select(title, name, id, url) |>
diff --git a/data-raw/generate_roxygen_mdeb.R b/data-raw/generate_roxygen_mdeb.R
index a68e179..174cea6 100644
--- a/data-raw/generate_roxygen_mdeb.R
+++ b/data-raw/generate_roxygen_mdeb.R
@@ -1,34 +1,37 @@
# function to generate a consistent Roxygen file for data documentation
generate_roxygen_mdeb <- function(dataset_name, title, description) {
-
# check that dataset_name has an *.rda ext
stopifnot(endsWith(dataset_name, '.rda'))
-
+
# load data
load(here::here('data', dataset_name))
-
+
# re-assign
mdeb_obj <- dataset_name |>
tools::file_path_sans_ext() |>
get()
-
+
# extract metadata
- geometry_type <- sf::st_geometry_type(mdeb_obj) |>
- unique() |>
+ geometry_type <- sf::st_geometry_type(mdeb_obj) |>
+ unique() |>
as.character()
dimension <- sf::st_dimension(mdeb_obj) |>
- unique()
+ unique()
dimension_type <- ifelse(dimension == 2, 'XY', NA_character_)
bbox <- sf::st_bbox(mdeb_obj)
projection <- sf::st_crs(mdeb_obj, parameters = TRUE)$Name
num_features <- nrow(mdeb_obj)
num_columns <- ncol(mdeb_obj)
-
+
# build the file path
- file_path <- file.path("R", paste0("data-", tools::file_path_sans_ext(dataset_name), ".R"))
-
+ file_path <- file.path(
+ "R",
+ paste0("data-", tools::file_path_sans_ext(dataset_name), ".R")
+ )
+
# substitute values into the template
- roxygen_content <- glue::glue("
+ roxygen_content <- glue::glue(
+ "
#' { title }
#'
#' @description { description }
@@ -57,10 +60,12 @@ generate_roxygen_mdeb <- function(dataset_name, title, description) {
#' plot(sf::st_geometry({ tools::file_path_sans_ext(dataset_name) }))
#' }}
NULL
-")
-
+"
+ )
+
# write content to file
writeLines(roxygen_content, con = file_path)
- message(glue::glue("Generated Roxygen file for '{ tools::file_path_sans_ext(dataset_name) }' at: { file_path }"))
-
+ message(glue::glue(
+ "Generated Roxygen file for '{ tools::file_path_sans_ext(dataset_name) }' at: { file_path }"
+ ))
}
diff --git a/data-raw/get_amapps_grid_sf.R b/data-raw/get_amapps_grid_sf.R
index 233d013..c81227e 100644
--- a/data-raw/get_amapps_grid_sf.R
+++ b/data-raw/get_amapps_grid_sf.R
@@ -7,20 +7,18 @@
# function
get_amapps_grid_sf <- function(save_clean = TRUE) {
-
# read in .tif file
amapps_grid <- here::here('data-raw/gis/AMAPPS_10km_grid.tif') |>
terra::rast() |>
terra::as.polygons() |>
sf::st_as_sf()
-
+
# save or not
if (save_clean) {
usethis::use_data(amapps_grid, overwrite = TRUE)
} else {
return(amapps_grid)
}
-
}
# run
diff --git a/data-raw/get_epu_sf.R b/data-raw/get_epu_sf.R
index 48e4220..73f682a 100644
--- a/data-raw/get_epu_sf.R
+++ b/data-raw/get_epu_sf.R
@@ -7,17 +7,20 @@
library(sf)
library(rgdal)
-gis.dir <- here::here('data-raw','gis')
+gis.dir <- here::here('data-raw', 'gis')
-get_epu_sf <- function(save_clean){
+get_epu_sf <- function(save_clean) {
crs <- "+proj=longlat +lat_1=35 +lat_2=45 +lat_0=40 +lon_0=-77+x_0=0
+y_0=0 +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0"
- epu_shp <- sf::st_as_sf(rgdal::readOGR(file.path(gis.dir, "EPU_Extended.shp"), verbose = F))
+ epu_shp <- sf::st_as_sf(rgdal::readOGR(
+ file.path(gis.dir, "EPU_Extended.shp"),
+ verbose = F
+ ))
sf::st_crs(epu_shp) <- crs
epu_sf <- as(epu_shp, "sf")
-
- if (save_clean){
+
+ if (save_clean) {
usethis::use_data(epu_sf, overwrite = TRUE)
} else {
return(epu_sf)
@@ -25,4 +28,3 @@ get_epu_sf <- function(save_clean){
}
get_epu_sf(save_clean = TRUE)
-
diff --git a/data-raw/get_mdeb_data.R b/data-raw/get_mdat_data.R
similarity index 70%
rename from data-raw/get_mdeb_data.R
rename to data-raw/get_mdat_data.R
index 0ba3173..faf780b 100644
--- a/data-raw/get_mdeb_data.R
+++ b/data-raw/get_mdat_data.R
@@ -1,45 +1,45 @@
-#' Get data from the MDEB (Marine Development and Ecology Branch) GIS Data Hub
-#' hosted on NOAA's Geoplatform
+#' Get data from the MDAT (Marine Development and Advanced Technology Program) GIS Data Hub
+#' hosted on NOAA's GeoPlatform
#'
#' @description
-#' This function retrieves data from the \href{https://mdeb-nefsc-noaa.hub.arcgis.com/}{MDEB GIS Data Hub}.
+#' This function retrieves data from the \href{https://mdeb-nefsc-noaa.hub.arcgis.com/}{MDAT GIS Data Hub}.
#'
#' @param dataset_name Name of the dataset to retrieve.
#' @param dataset_id ID of the dataset layer to retrieve.
#'
#' @section Available data:
#' The list of available data and corresponding REST URLs
-#' can be found by running `find_mdeb_data()`.
+#' can be found by running `find_mdat_data()`.
#'
#' @return An sf data.frame-like object
#'
#' @examples
-#' # Pull EcoMon Survey strata from MDEB GIS Data Hub
-#' ecomon_strata <- get_mdeb_data(dataset_name = "Ecosystem Monitoring Survey", dataset_id = 1)
+#' # Pull EcoMon Survey strata from MDAT GIS Data Hub
+#' ecomon_strata <- get_mdat_data(dataset_name = "Ecosystem Monitoring Survey", dataset_id = 1)
#' # Plot the data
#' plot(ecomon_strata)
#'
#' @export
-get_mdeb_data <- function(dataset_name = NULL, dataset_id = NULL) {
+get_mdat_data <- function(dataset_name = NULL, dataset_id = NULL) {
# check if dataset_name, dataset_id is NULL
if (is.null(dataset_name) || is.null(dataset_id)) {
message(
"Neither dataset_name or id can be NULL.
To find the list of available datasets, please use run
- find_mdeb_data()."
+ find_mdat_data()."
)
return()
}
- allData <- find_mdeb_data()
+ allData <- find_mdat_data()
set <- allData |>
dplyr::filter(title == dataset_name, id == dataset_id)
if (nrow(set) == 0) {
stop(
- "Data set not found. To find the list of available datasets, please use run
- find_mdeb_data()"
+ "Data set not found. To find the list of available datasets, please run
+ find_mdat_data()"
)
}
@@ -49,7 +49,7 @@ get_mdeb_data <- function(dataset_name = NULL, dataset_id = NULL) {
httr2::req_url_query(where = "1=1", outFields = "*", f = "geoJSON") |>
httr2::req_perform()
if (dataset$status_code == 200) {
- dataset_sf = dataset |>
+ dataset_sf <- dataset |>
httr2::resp_body_string() |>
sf::read_sf()
return(dataset_sf)
diff --git a/data-raw/get_mdeb_for_package.R b/data-raw/get_mdat_for_package.R
similarity index 80%
rename from data-raw/get_mdeb_for_package.R
rename to data-raw/get_mdat_for_package.R
index df8c84b..e319fea 100644
--- a/data-raw/get_mdeb_for_package.R
+++ b/data-raw/get_mdat_for_package.R
@@ -1,24 +1,24 @@
-#' Pull all content from MDEB data hub and create sf objects
+#' Pull all content from MDAT data hub and create sf objects
#'
#' Pulls the data and converts to sf, then saves as part of the package
#'
#'
#'
-source(here::here("data-raw/find_mdeb_data.R"))
-source(here::here("data-raw/get_mdeb_data.R"))
-source(here::here("data-raw/generate_roxygen_mdeb.R"))
+source(here::here("data-raw/find_mdat_data.R"))
+source(here::here("data-raw/get_mdat_data.R"))
+source(here::here("data-raw/generate_roxygen_mdat.R"))
-get_mdeb_for_package <- function(overwrite = FALSE) {
- # find all the data set on the MDEB HUB
- datasets <- find_mdeb_data()
+get_mdat_for_package <- function(overwrite = FALSE) {
+ # find all the data set on the MDAT HUB
+ datasets <- find_mdat_data()
# loop through each and save as rda file.
# also create documentation for each dataset
for (ids in 1:nrow(datasets)) {
dataset <- datasets[ids, ]
message("Processing: ", dataset$title)
- data <- get_mdeb_data(dataset$title, dataset$id)
+ data <- get_mdat_data(dataset$title, dataset$id)
if (!is.null(data)) {
# Save the data as an R object in the package
dataset_name <- tolower(gsub("SMIT_", "", dataset$name))
@@ -52,7 +52,7 @@ get_mdeb_for_package <- function(overwrite = FALSE) {
)
}
# Generate Roxygen data doc
- generate_roxygen_mdeb(
+ generate_roxygen_mdat(
dataset_name = paste0(dataset_name, '.rda'),
title = dataset$title,
description = modified_dataset_description
diff --git a/data-raw/get_nmfs_remote_sf.R b/data-raw/get_nmfs_remote_sf.R
index 4a87d36..b62bbe5 100644
--- a/data-raw/get_nmfs_remote_sf.R
+++ b/data-raw/get_nmfs_remote_sf.R
@@ -3,5 +3,9 @@
# Download and process spatial data from NOAA Fisheries (NMFS) websites (New England/Mid-Atlantic)
# download, process, and save
-create_sf_data_from_url(url = 'https://media.fisheries.noaa.gov/2022-08/LMA1_Restricted_Area_FR_2.zip')
-create_sf_data_from_url(url = 'https://media.fisheries.noaa.gov/2022-08/Great_South_Channel_Restricted_Trap-Pot_Area_2.zip')
+create_sf_data_from_url(
+ url = 'https://media.fisheries.noaa.gov/2022-08/LMA1_Restricted_Area_FR_2.zip'
+)
+create_sf_data_from_url(
+ url = 'https://media.fisheries.noaa.gov/2022-08/Great_South_Channel_Restricted_Trap-Pot_Area_2.zip'
+)
diff --git a/data-raw/list_files_ftp.R b/data-raw/list_files_ftp.R
index 3c694dd..092f523 100644
--- a/data-raw/list_files_ftp.R
+++ b/data-raw/list_files_ftp.R
@@ -23,14 +23,11 @@
#'
#' @export
#'
-list_files_ftp <- function(url,
- sort = FALSE,
- verbose = FALSE) {
-
+list_files_ftp <- function(url, sort = FALSE, verbose = FALSE) {
# Do
x <- url %>%
purrr::map(
- ~list_files_ftp_worker(
+ ~ list_files_ftp_worker(
url = .,
credentials = "",
sleep = NA,
@@ -40,17 +37,19 @@ list_files_ftp <- function(url,
purrr::flatten_chr()
# Sort remote file names
- if (sort) x <- sort(x)
+ if (sort) {
+ x <- sort(x)
+ }
return(x)
}
-
list_files_ftp_worker <- function(url, credentials, sleep, verbose) {
-
# Message to user
- if (verbose) message(date_message(), "`", url, "`...")
+ if (verbose) {
+ message(date_message(), "`", url, "`...")
+ }
# url must be prefixed with ftp or sftp
if (!grepl("^ftp://|^sftp://", url)) {
@@ -62,20 +61,21 @@ list_files_ftp_worker <- function(url, credentials, sleep, verbose) {
# Get the file list
# If credentials are blank, this will still work
- file_list <- tryCatch({
-
- RCurl::getURL(
- url,
- userpwd = credentials,
- ftp.use.epsv = FALSE,
- dirlistonly = TRUE,
- forbid.reuse = TRUE,
- .encoding = "UTF-8"
- )
-
- }, error = function(e) {
- as.character()
- })
+ file_list <- tryCatch(
+ {
+ RCurl::getURL(
+ url,
+ userpwd = credentials,
+ ftp.use.epsv = FALSE,
+ dirlistonly = TRUE,
+ forbid.reuse = TRUE,
+ .encoding = "UTF-8"
+ )
+ },
+ error = function(e) {
+ as.character()
+ }
+ )
# Make a vector
if (length(file_list) != 0) {
@@ -83,8 +83,9 @@ list_files_ftp_worker <- function(url, credentials, sleep, verbose) {
file_list <- stringr::str_trim(file_list)
}
- if (!is.na(sleep[1])) Sys.sleep(sleep)
+ if (!is.na(sleep[1])) {
+ Sys.sleep(sleep)
+ }
return(file_list)
-
}
diff --git a/data-raw/standardize_data_dims.R b/data-raw/standardize_data_dims.R
index b3c084d..ac4aacc 100644
--- a/data-raw/standardize_data_dims.R
+++ b/data-raw/standardize_data_dims.R
@@ -5,39 +5,41 @@ all_data <- data(package = 'NEFSCspatial')
## extract names
data_names <- all_data$results[, 'Item']
-data_names <- data_names[!data_names %in% c('ecomon_stations')]
+data_names <- data_names[!data_names %in% c('ecomon_stations')]
## loop through each dataset
for (i in data_names) {
-
# load data
load(here::here('data', paste0(i, '.rda')))
-
+
# re-assign
data_obj <- i |>
get()
-
+
# dimensions
num_features <- nrow(data_obj)
num_columns <- ncol(data_obj)
- data_dim <- glue::glue("#' \\item{{Features}}{{{ num_features } x { num_columns }}")
-
+ data_dim <- glue::glue(
+ "#' \\item{{Features}}{{{ num_features } x { num_columns }}"
+ )
+
# build the file path
file_path <- file.path("R", paste0("data_", i, ".R"))
- if (!file.exists(file_path)) file_path <- file.path("R", paste0("data-", i, ".R"))
+ if (!file.exists(file_path)) {
+ file_path <- file.path("R", paste0("data-", i, ".R"))
+ }
# read in data documentation
data_doc <- readLines(con = file_path)
-
+
# find Features
- replace_id = grep(pattern = 'Features', x = data_doc)
+ replace_id <- grep(pattern = 'Features', x = data_doc)
stopifnot(length(replace_id) == 1)
-
+
# replace
data_doc[replace_id] <- data_dim
-
+
# write
writeLines(data_doc, con = file_path)
message(glue::glue("Updated Roxygen file for '{ i }' at: { file_path }"))
-
}
diff --git a/data/BTS_Strata.rda b/data/BTS_Strata.rda
deleted file mode 100644
index aa7c267..0000000
Binary files a/data/BTS_Strata.rda and /dev/null differ
diff --git a/data/EcoMon_Strata.rda b/data/EcoMon_Strata.rda
deleted file mode 100644
index 1e52aed..0000000
Binary files a/data/EcoMon_Strata.rda and /dev/null differ
diff --git a/data/Shellfish_Strata.rda b/data/Shellfish_Strata.rda
deleted file mode 100644
index cc79cd4..0000000
Binary files a/data/Shellfish_Strata.rda and /dev/null differ
diff --git a/data/Shrimp_Strata.rda b/data/Shrimp_Strata.rda
deleted file mode 100644
index 379e905..0000000
Binary files a/data/Shrimp_Strata.rda and /dev/null differ
diff --git a/data/bts_strata.rda b/data/bts_strata.rda
new file mode 100644
index 0000000..03277ad
Binary files /dev/null and b/data/bts_strata.rda differ
diff --git a/data/ecomon_stations.rda b/data/ecomon_stations.rda
new file mode 100644
index 0000000..b573519
Binary files /dev/null and b/data/ecomon_stations.rda differ
diff --git a/data/ecomon_strata.rda b/data/ecomon_strata.rda
new file mode 100644
index 0000000..c36e3b5
Binary files /dev/null and b/data/ecomon_strata.rda differ
diff --git a/data/shrimp_strata.rda b/data/shrimp_strata.rda
new file mode 100644
index 0000000..6dfbc72
Binary files /dev/null and b/data/shrimp_strata.rda differ
diff --git a/man/BTS_Strata.Rd b/man/BTS_Strata.Rd
deleted file mode 100644
index 20f27b7..0000000
--- a/man/BTS_Strata.Rd
+++ /dev/null
@@ -1,36 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/data_BTS_strata.R
-\docType{data}
-\name{BTS_Strata}
-\alias{BTS_Strata}
-\title{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}}
-\format{
-An \code{sf} object:
-\describe{
-\item{Geometry type}{POLYGON}
-\item{dimension}{XY}
-\item{Bounding box}{xmin: -79.18422 ymin: 32.50221 xmax: -65.16869 ymax: 44.83202}
-\item{Geodetic CRS}{NAD 83}
-\item{Features}{185 x 10}
-\item{Metadata}{See source}
-}
-}
-\source{
-\url{https://drive.google.com/drive/folders/15s70lDwezatlNVReDMWRJadtlklMYSnC}
-
-\url{https://www.fisheries.noaa.gov/inport/item/33471}
-}
-\usage{
-data("BTS_Strata")
-}
-\description{
-NEFSC Bottom Trawl Survey Strata
-}
-\details{
-An \code{sf} object containing the boundaries of the NEFSC bottom trawl survey strata.
-This set of strata is considered historical. (Pre 2000).
-}
-\note{
-Use \url{https://mdeb-nefsc-noaa.hub.arcgis.com/datasets/noaa::bottom-trawl-survey/about} instead.
-}
-\keyword{datasets}
diff --git a/man/EcoMon_Strata.Rd b/man/EcoMon_Strata.Rd
deleted file mode 100644
index f31b80d..0000000
--- a/man/EcoMon_Strata.Rd
+++ /dev/null
@@ -1,33 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/data_EcoMon_Strata.R
-\docType{data}
-\name{EcoMon_Strata}
-\alias{EcoMon_Strata}
-\title{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}}
-\format{
-A data frame/ \code{sf} object
-\describe{
-\item{Geometry type}{POLYGON}
-\item{Dimension}{XY}
-\item{Bounding box}{xmin: -75.96791 ymin: 35.14219 xmax: -65.16869 ymax: 44.48558}
-\item{Geodetic CRS}{NAD83}
-\item{Features}{47 x 4}
-\item{Metadata}{See source}
-}
-}
-\source{
-\url{https://www.fisheries.noaa.gov/inport/item/33468}
-}
-\usage{
-data("EcoMon_Strata")
-}
-\description{
-Ecosystem Monitoring Cruise (EcoMon) strata
-}
-\details{
-An sf object containing the EcoMon strata
-}
-\note{
-Use \url{https://mdeb-nefsc-noaa.hub.arcgis.com/datasets/noaa::ecosystem-monitoring-survey/about} instead.
-}
-\keyword{datasets}
diff --git a/man/Shellfish_Strata.Rd b/man/Shellfish_Strata.Rd
deleted file mode 100644
index dd10681..0000000
--- a/man/Shellfish_Strata.Rd
+++ /dev/null
@@ -1,33 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/data_Shellfish_strata.R
-\docType{data}
-\name{Shellfish_Strata}
-\alias{Shellfish_Strata}
-\title{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}}
-\format{
-A data frame/ \code{sf} object
-\describe{
-\item{Geometry type}{POLYGON}
-\item{Dimension}{XY}
-\item{Bounding box}{xmin: -75.95982 ymin: 35.50142 xmax: -65.89944 ymax: 42.16817}
-\item{Geodetic CRS}{NAD83}
-\item{Features}{97 x 10}
-\item{Metadata}{See source}
-}
-}
-\source{
-\url{https://www.fisheries.noaa.gov/inport/item/33466}
-}
-\usage{
-data("Shellfish_Strata")
-}
-\description{
-Shellfish strata (Clam and Scallop surveys)
-}
-\details{
-An sf object containing the Clam and Scallop survey strata
-}
-\note{
-Use \url{https://mdeb-nefsc-noaa.hub.arcgis.com/maps/noaa::atlantic-surfclam-and-ocean-quahog-survey/about} or \url{https://mdeb-nefsc-noaa.hub.arcgis.com/maps/noaa::sea-scallop-survey/about} instead.
-}
-\keyword{datasets}
diff --git a/man/Shrimp_Strata.Rd b/man/Shrimp_Strata.Rd
deleted file mode 100644
index f771a95..0000000
--- a/man/Shrimp_Strata.Rd
+++ /dev/null
@@ -1,33 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/data_Shrimp_strata.R
-\docType{data}
-\name{Shrimp_Strata}
-\alias{Shrimp_Strata}
-\title{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}}
-\format{
-A data frame/ \code{sf} object
-\describe{
-\item{Geometry type}{POLYGON}
-\item{Dimension}{XY}
-\item{Bounding box}{xmin: -70.68152 ymin: 41.08476 xmax: -67.99941 ymax: 44.08762}
-\item{Geodetic CRS}{NAD83}
-\item{Features}{12 x 5}
-\item{Metadata}{See source}
-}
-}
-\source{
-\url{https://www.fisheries.noaa.gov/inport/item/33470}
-}
-\usage{
-data("Shrimp_Strata")
-}
-\description{
-Shrimp survey strata
-}
-\details{
-An sf object containing the Shrimp survey strata
-}
-\note{
-Use \url{https://mdeb-nefsc-noaa.hub.arcgis.com/datasets/noaa::northern-shrimp-survey/about} instead.
-}
-\keyword{datasets}
diff --git a/man/bts_strata.Rd b/man/bts_strata.Rd
new file mode 100644
index 0000000..8d6bb46
--- /dev/null
+++ b/man/bts_strata.Rd
@@ -0,0 +1,36 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/data-bts_strata.R
+\docType{data}
+\name{bts_strata}
+\alias{bts_strata}
+\title{Bottom Trawl Survey}
+\format{
+An \code{sf} object:
+\describe{
+\item{Geometry type}{POLYGON}
+\item{Dimension}{XY}
+\item{Bounding box}{xmin: -76.2 ymin: 34.4 xmax: -65.6 ymax: 44.5}
+\item{Projected CRS}{WGS 84}
+\item{Features}{82 x 16}
+\item{Metadata}{See source}
+}
+}
+\source{
+{https://mdeb-nefsc-noaa.hub.arcgis.com/}
+}
+\usage{
+data('bts_strata')
+}
+\description{
+An \code{sf} object containing spatial data for the Bottom Trawl Survey. Scientific survey strata for the Bottom Trawl Survey.
+}
+\examples{
+\dontrun{
+# Load the dataset
+data(bts_strata)
+
+# Plot the geometry
+plot(sf::st_geometry(bts_strata))
+}
+}
+\keyword{{datasets}}
diff --git a/man/ecomon_stations.Rd b/man/ecomon_stations.Rd
new file mode 100644
index 0000000..87b1837
--- /dev/null
+++ b/man/ecomon_stations.Rd
@@ -0,0 +1,36 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/data-ecomon_stations.R
+\docType{data}
+\name{ecomon_stations}
+\alias{ecomon_stations}
+\title{Ecosystem Monitoring Survey}
+\format{
+An \code{sf} object:
+\describe{
+\item{Geometry type}{POINT}
+\item{Dimension}{NA}
+\item{Bounding box}{xmin: -75.5 ymin: 36 xmax: -65.4 ymax: 44.5}
+\item{Projected CRS}{WGS 84}
+\item{Features}{35 x 14}
+\item{Metadata}{See source}
+}
+}
+\source{
+{https://mdeb-nefsc-noaa.hub.arcgis.com/}
+}
+\usage{
+data('ecomon_stations')
+}
+\description{
+An \code{sf} object containing spatial data for the Ecosystem Monitoring Survey. There are thirty-five Ecosystem Monitoring fixed hydrographic sampling stations across the Northeast Shelf ecosystem. Four transects run from inshore to off the continental shelf from north of Cape Hatteras to Cape Cod. One transect bisects the Gulf of Maine from the coast of Maine and across Georges Bank. The remaining twelve stations in the Gulf of Maine sample deep basins, banks, coastal areas, and the inflow (Northeast Channel) and out flow (Great South Channel) of the gulf.
+}
+\examples{
+\dontrun{
+# Load the dataset
+data(ecomon_stations)
+
+# Plot the geometry
+plot(sf::st_geometry(ecomon_stations))
+}
+}
+\keyword{{datasets}}
diff --git a/man/ecomon_strata.Rd b/man/ecomon_strata.Rd
new file mode 100644
index 0000000..6bfd142
--- /dev/null
+++ b/man/ecomon_strata.Rd
@@ -0,0 +1,36 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/data-ecomon_strata.R
+\docType{data}
+\name{ecomon_strata}
+\alias{ecomon_strata}
+\title{Ecosystem Monitoring Survey}
+\format{
+An \code{sf} object:
+\describe{
+\item{Geometry type}{MULTIPOLYGON}
+\item{Dimension}{XY}
+\item{Bounding box}{xmin: -76 ymin: 35.1 xmax: -65.2 ymax: 44.5}
+\item{Projected CRS}{WGS 84}
+\item{Features}{48 x 13}
+\item{Metadata}{See source}
+}
+}
+\source{
+{https://mdeb-nefsc-noaa.hub.arcgis.com/}
+}
+\usage{
+data('ecomon_strata')
+}
+\description{
+An \code{sf} object containing spatial data for the Ecosystem Monitoring Survey. Ecosystem Monitoring plankton stations are selected using a random-stratified design based on the Northeast Fisheries Science Center bottom trawl survey design. There are forty-seven plankton strata across the Northeast Shelf ecosystem. The strata are combined into four regions from Cape Hatteras to Cape Sable (Mid-Atlantic Bight, Southern New England, Georges Bank, and Gulf of Maine). Thirty randomly selected stations are targeted for sampling from each region during a survey.
+}
+\examples{
+\dontrun{
+# Load the dataset
+data(ecomon_strata)
+
+# Plot the geometry
+plot(sf::st_geometry(ecomon_strata))
+}
+}
+\keyword{{datasets}}
diff --git a/man/shrimp_strata.Rd b/man/shrimp_strata.Rd
new file mode 100644
index 0000000..ea9cc5f
--- /dev/null
+++ b/man/shrimp_strata.Rd
@@ -0,0 +1,36 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/data-shrimp_strata.R
+\docType{data}
+\name{shrimp_strata}
+\alias{shrimp_strata}
+\title{Northern Shrimp Survey}
+\format{
+An \code{sf} object:
+\describe{
+\item{Geometry type}{POLYGON}
+\item{Dimension}{XY}
+\item{Bounding box}{xmin: -70.7 ymin: 41.1 xmax: -68 ymax: 44.1}
+\item{Projected CRS}{WGS 84}
+\item{Features}{12 x 9}
+\item{Metadata}{See source}
+}
+}
+\source{
+{https://mdeb-nefsc-noaa.hub.arcgis.com/}
+}
+\usage{
+data('shrimp_strata')
+}
+\description{
+An \code{sf} object containing spatial data for the Northern Shrimp Survey. Scientific survey strata for the Northern Shrimp Survey.
+}
+\examples{
+\dontrun{
+# Load the dataset
+data(shrimp_strata)
+
+# Plot the geometry
+plot(sf::st_geometry(shrimp_strata))
+}
+}
+\keyword{{datasets}}
diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml
index 0a008df..bda7f5b 100644
--- a/pkgdown/_pkgdown.yml
+++ b/pkgdown/_pkgdown.yml
@@ -1,47 +1,52 @@
url: https://nefsc.github.io/NEFSC-Spatial/
+home:
+ title: NEFSC Spatial Data for R
+
+authors:
+ Andy Beet:
+ href: https://andybeet.com
+ Joshua Hatch:
+ href: https://github.com/jmhatch-NOAA
+ Kimberly Bastille:
+ href: https://github.com/kimberly-bastille
+
template:
- bootstrap: 3
+ bootstrap: 5
+ math-rendering: mathjax
+ light-switch: false
+ bslib:
+ primary: "#004391"
+ danger: "#0085CA"
+ border-radius: 0.5rem
+ btn-border-radius: 0.25rem
deploy:
install_metadata: true
navbar:
+ bg: primary
structure:
- left:
- - home
- - getting started
- - reference
- - issue
- - articles
- right:
- - search
- - github
+ left: [getting started, reference, issue, articles, news]
+ right: [search, github]
components:
- home:
- icon: fas fa-home fa-lg
- href: index.html
- aria-label: Home
getting started:
text: Getting Started
- icon: fas fa-solid fa-play
href: articles/NEFSCspatial.html
reference:
text: Data
- icon: fas fa-database fa-lg
href: reference/index.html
issue:
text: Issues
- icon: fas fa-question-circle fa-lg
href: https://github.com/NEFSC/NEFSC-Spatial/issues
articles:
text: Articles
- icon: fas fa-file-contract fa-lg
menu:
- - text: MDEB datasets
- href: articles/mdeb_datasets.html
+ - text: MDAT Datasets
+ href: articles/mdat_datasets.html
- text: Team Members
href: articles/teamMembers.html
+
reference:
- title: Fishing Areas / Management Areas
desc: Areas in which fishing is reported
@@ -63,10 +68,6 @@ reference:
- title: Survey Strata
desc: Areas in which survey sampling is reported
- contents:
- - "BTS_Strata"
- - "EcoMon_Strata"
- - "Shellfish_Strata"
- - "Shrimp_Strata"
- contains("strata")
- ends_with("stations")
- ends_with("deployments")
@@ -75,12 +76,3 @@ reference:
desc: Areas defining model boundaries
- contents:
- "Neus_atlantis"
-
-
-authors:
- Andy Beet:
- href: https://andybeet.com
- Kimberly Bastille:
- href: https://github.com/kimberly-bastille
- Joshua Hatch:
- href: https://github.com/jmhatch-NOAA
diff --git a/pkgdown/extra.css b/pkgdown/extra.css
index 5d3630a..1b8694a 100644
--- a/pkgdown/extra.css
+++ b/pkgdown/extra.css
@@ -1,203 +1,12 @@
-/*---Use template from: https://ocsdata.ncd.noaa.gov/HSRP/css/ocs-fonts.css---*/
-/*---Use template from: https://www.legislative.noaa.gov/noaa-web/css/contentFormatting.css---*/
-body {
- font-family: "Open Sans", sans-serif;
- font-size: 14px;
- line-height: 1.42857143;
- color: #000000;
- background-color: #FFFFFF;
+h1, h2, h3, h4, h5, h6 {
+ color: #004391 !important;
}
-.fas fa-home fa-lg{
- background-color: #FFFFFF;
+.form-inline .form-control {
+ background-color: #f0f0f0;
}
-h1, h2, h3, h4, h5, h6, p {
- font-family: "Open Sans", sans-serif;
- color: #00467f;
-}
-
-
-h1 {
- font-size: 36px;
-}
-
-h2 {
- font-size: 20px;
-}
-
-h3 {
- font-size: 18px
-}
-
-h4 {
- font-size: 16px
-}
-
-h5 {
- font-size: 14px;
- line-height: 22px;
- margin-bottom: 10px;
-}
-
-h6 {
- font-size: 14px;
-}
-
-p {
- margin-top: 0px;
- line-height: 19px;
- margin-bottom: .9em;
- text-align: left;
- color: #000000;
-}
-
-h1.title {
- font-family: "Open Sans", sans-serif;
- font-size: 40px;
- line-height: 40px;
- margin-bottom: 25px;
- letter-spacing: 0px;
- font-weight: 700;
- color: #00467f;
-}
-
-h1.mobile {
- font-family: "Open Sans", sans-serif;
- font-size: 40px;
- line-height: 40px;
- margin-bottom: 25px;
- letter-spacing: 0px;
- font-weight: 700;
- color: #00467f;
-}
-
-a { font-weight: bold; }
-a:link { color: #007eb2; }
-a:visited { color: #007eb2; }
-a:hover { color: #007eb2; }
-
-.leftAlignImage img, .rightAlignImage img {
- width: 200px;
- border: none;
-}
-
-.leftAlignImage, .rightAlignImage {
- padding: 4px;
- border: none;
- width: 200px;
- height: auto;
-}
-
-.leftAlignImage {
- float: left;
- margin-right: 10px;
-}
-
-.rightAlignImage {
- float: right;
- margin-left: 10px;
-}
-
-.rightAlignImage p:first-child, .leftAlignImage p:first-child {
- margin-left: 0px;
- margin-top: 0px;
-}
-
-.rightAlignImage p, .leftAlignImage p {
- margin-bottom: 0px;
- margin-top: 6px;
-}
-
-/*---navbar ---*/
-.navbar {
- margin-bottom: 0px;
- border-radius: 0px;
- color: #FFFFFF;
- background-color: #054698;
- width: auto;
-}
-
-.navbar-default .navbar-nav>li>a {
- color: #FFFFFF;
- background-color: #054698;
-} /*navbar text*/
-
-
-.navbar-default .navbar-link {
- color: #FFFFFF;
-} /*navbar link*/
-
-.navbar-default .navbar-link:focus, .navbar-default .navbar-link:hover {
- color: #FFFFFF;
- text-decoration: underline;
-}
-
-.nav>li {
- position: relative;
- color: #054698;
-}
-
-.navbar-default .navbar-nav>li>a:focus, .navbar-default .navbar-nav>li>a:hover {
- color: #FFFFFF;
- text-decoration: underline;
-}
-
-.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:focus, .navbar-default .navbar-nav>.open>a:hover {
- color: #FFFFFF;
- text-decoration: underline;
- background-color: #054698;
-}
-
-.navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:focus, .navbar-default .navbar-nav>.active>a:hover {
- color: #FFFFFF;
- background-color: #054698;
- text-decoration: underline;
-} /*Home button*/
-
-nav[data-toggle='toc'] .nav > li > a {
- padding: 4px 20px 4px 6px;
- font-size: 1.5rem;
- font-weight: 400;
- color: #00467f;
- background-color: #FFFFFF;
-} /*Table of content in the vignettes*/
-
-nav[data-toggle='toc'] .nav > li > a:focus, nav[data-toggle='toc'] .nav > li > a:hover{
- color: #00467f;
- background-color: #FFFFFF;
-}
-
-nav[data-toggle='toc'] .nav > .active > a, nav[data-toggle='toc'] .nav > .active:hover > a, nav[data-toggle='toc'] .nav > .active:focus > a {
- color: #FFFFFF;
-}
-
-/*---footer---*/
-footer {
- font-size: 14px;
- color: #00467f;
- background-color: #FFFFFF;
- padding-top: 15px;
- margin-bottom: 0px;
- border-radius: 0px;
- width: auto;
-}
-
-footer p {
- margin-left: 3px;
- margin-right: 3px;
- color: #00467f;
-}
-
-footer a:link { color: #00467f; text-decoration: none; }
-footer a:visited { color: #00467f; text-decoration: none; }
-footer a:hover { color: #00467f; text-decoration: none; }
-
-/*---fix footer txt alignment---*/
-footer .pkgdown p {
- text-align: right;
-}
-
-footer .copyright p {
- text-align: left;
-}
+.form-inline .form-control::placeholder {
+ color: #004391;
+ opacity: 0.5;
+}
\ No newline at end of file
diff --git a/vignettes/teamMembers.Rmd b/vignettes/teamMembers.Rmd
index bcb305e..6bb31c8 100644
--- a/vignettes/teamMembers.Rmd
+++ b/vignettes/teamMembers.Rmd
@@ -17,4 +17,4 @@ knitr::opts_chunk$set(echo = TRUE)
|---|---|---|---|
|
| [kimberly-bastille](https://github.com/kimberly-bastille) | READ | SSB |
|
| [andybeet](https://github.com/andybeet) | READ | EDAB |
-|
| [jmhatch](https://github.com/jmhatch) | PEMAD | OWEB |
+|
| [jmhatch](https://github.com/jmhatch) | PEMAD | MDEB |