Thank you for your interest in contributing to EFHSDM! We plan to maintain this package as a resource for stakeholders, modelers, and researchers interested in species distribution modeling and the description of Essential Fish Habitat.
- View other EFH work products or request data products here
- Report bugs here
- Contact maintainers: Margaret at margaret (dot) siple (at) noaa.gov and Jeremy Harris, jeremy (dot) harris (at) noaa.gov.
Bugs are tracked as GitHub issues. If you find a bug, please make your report as detailed as possible.
Note: If you find a Closed issue that looks like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one (you can tag issues by a hashtag (#) followed by the issue number).
📝 We are always interested in how to make this package more useful and accessible. If you have an enhancement to suggest, please submit an issue and tag it as a feature request.
Enhancement suggestions are tracked as GitHub issues. Create an issue on the EFHSDM repository and include the following:
- 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.
- Provide specific examples to demonstrate the steps. Include copy/pasteable snippets which you use in those examples, as Markdown code blocks.
- Describe the current behavior and explain which behavior you expected to see instead and why.
- Include screenshots and animated GIFs which help you demonstrate the steps or point out the part of Atom which the suggestion is related to. You can use this tool to record GIFs on macOS and Windows, and this tool or this tool on Linux.
- Explain why this enhancement would be useful to most
EFHSDMusers and stakeholders. - Specify the name and version of the OS you're using.
If you have a code suggestion in hand, please submit a pull request.
(many of these are lifted from the Atom style guide for commit messages)
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
- When only changing documentation, include
[ci skip]in the commit title - Consider starting the commit message with an applicable emoji:
- 🎨
:art:when improving the format/structure of the code - 🐎
:racehorse:when improving performance - 📝
:memo:when writing docs - 🐧
:penguin:when fixing something on Linux - 🍎
:apple:when fixing something on macOS - 🏁
:checkered_flag:when fixing something on Windows - 🐛
:bug:when fixing a bug - 🔥
:fire:when removing code or files - ✅
:white_check_mark:when adding tests - ⬆️
:arrow_up:when upgrading dependencies - ⬇️
:arrow_down:when downgrading dependencies
- 🎨
- Guides
- Follow the tidyverse style guide
- References on R package development from Hadley's book R Packages
- Advanced R
- CRAN page
- Semantic versioning
- Code rules
- Use
vapplyorlapplyinstead ofsapplybecausesapplyis not consistent in the what class of object it returns (this may not yet be implemented in the package) - Use
[rather thansubsetbecausesubsetwill lead to unassigned objects, i.e., R will not know where the column vector name in thesubsetcall comes from - Use
<-rather than=to assign objects - Use
seq_len(NROW(x))orseq_along(x)rather than1:NROW(x)or1:length(x)(not yet implemented in the package) - Importing functions from other packages in ss3sim functions
- Use
(these guidelines are lifted and adapted from the ss3sim developer wiki, which contains a lot of useful resources for developing code)
What if you need to use a function from another package? Normally you might attach all the functions from a package with a call to library(). This is a bad practice in the context of writing an R package. We shouldn't be attaching other packages in the user's environment. In the context of writing a package we will instead import that function for our use. The package structure ensures that the user has the package installed.
For more details, see http://r-pkgs.had.co.nz/namespace.html
Say you want to use the function mle2 from the bbmle package.
Here are the steps to use the function within your package:
- Add the package to the list of
Importsin theDESCRIPTIONfile. If it's possible that functionality has changed in the past for the function then specify a>=version number for the package. You can find the version you have installed in many ways. One way is to typehelp(package = "bbmle")within R. You can also look at yoursessionInfo()in R. - In the function Rogxyen documentation include
@importFrom bbmle mle2. If there are multiple functions to import than list them as@importFrom packagename function1 function2etc. - Call the function as you would normally, e.g.,
mle2(x, ...)
The above steps outline one of two preferred notations. Within EFHSDM we also use the :: notation to be explicit about what package a function comes from. E.g., raster::raster() clearly tells readers of the code that the raster() function comes from the raster package without readers having to navigate to the top of the code to read the roxygen documentation. This notation also requires that packages be listed in the Imports section of the DESCRIPTION file. We support either notation, but we have largely switched to this one as time goes on.
Occasionally your code might call so many functions from another package that you just want all the functions available. In that case use @import bbmle (for example) at the top. We have done this in a few places in EFHSDM. But it is best practices to import specific functions that we need because it saves time, which users appreciate. It also makes the code more explicit.
Contributors to EFHSDM follow the Contributor Covenant code of conduct. For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq.