Thank you for your interest in contributing to mmrefpoints
! We hope to maintain this package as a resource for a broad set of stakeholders and modelers.
Bugs are tracked as GitHub issues. If you find a bug, please make your report as detailed as possible. Fill out the required bug report template; the information it asks for helps us resolve issues faster.
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).
:pencil: We are always interested in how to make this package more useful and accessible. If you have an enhancement to suggest, please submit a Feature Request.
Enhancement suggestions are tracked as GitHub issues. Create an issue on the mmrefpoints repository and include the following:
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)
[ci skip]
in the commit title: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 dependenciesWe have adapted the following coding style guidelines from simulation developers with established guidelines, like ss3sim.
You will notice that some of the functionality of mmrefpoints may not follow all the advice in this style guide. I am working on streamlining much of this code (especially the Shiny code :construction_worker:), so in the meantime we request that you do as we style guide, not as we do.
vapply
or lapply
instead of sapply
because sapply
is not consistent in the what class of object it returns (this may not yet be implemented in the package)[
rather than subset
because subset
will lead to unassigned objects, i.e., R will not know where the column vector name in the subset
call comes from<-
rather than =
to assign objectsseq_len(NROW(x))
or seq_along(x)
rather than 1:NROW(x)
or 1:length(x)
(not yet implemented in the package)(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:
Imports
in the DESCRIPTION
file. 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 type help(package = "bbmle")
within R. You can also look at your sessionInfo()
in R.@importFrom bbmle mle2
. If there are multiple functions to import than list them as @importFrom packagename function1 function2
etc.mle2(x, ...)
The above steps outline one of two preferred notations. Within mmrefpoints we also use the ::
notation to be explicit about what package a function comes from. E.g., shiny.i18n::update_lang()
clearly tells readers of the code that the update_lang()
function comes from the shiny.i18n 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
at the top. I have done this in places in mmrefpoints. 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 mmrefpoints follow the Contributor Covenant code of conduct. For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.