Contributing to browseMetadata
We warmly welcome contributions to the browseMetadata project! This document provides guidelines for contributing to this repository.
How to Contribute
Reporting Issues
- Bug Reports: If you find a bug, please open an issue with a clear description of the problem and steps to reproduce it.
- Feature Requests: Suggestions for new features or improvements are always welcome. Please open an issue to discuss your ideas.
Making Changes
- Fork the Repository: Start by forking the repository to your GitHub account.
- Create a Feature Branch: Create a new branch for your feature or fix.
- Make Your Changes: Implement your changes, adhering to the coding standards and practices outlined below.
- Test Your Changes: Ensure your changes do not break any existing functionality.
- Submit a Pull Request: Open a pull request from your feature branch to the main branch of the original repository.
Coding Standards
- Follow the tidyverse style guide for R code.
- Write clear, readable, and maintainable code.
- Include comments and documentation as needed.
Contributing to the R Package - as an author or reviewer of a PR
If your contribution involves changes to the R package itself (as an author or reviewer of a PR), here are some specific guidelines, assuming you are using RStudio as your editor:
- Clone this GitHub repository locally and ensure all branches you need are up to date with remote. > In R Studio, you can clone it by clicking on
File
>New Project...
, then selectVersion Control
, and chooseGit
. Enter the repository URL (e.g.,https://github.com/aim-rsf/browseMetadata
), select the directory to clone the repository into, and clickCreate Project
. - You should have a Git tab in your workspace.
- In this Git tab, move to the branch you want to make changes in (or review and test the changes of someone else).
- Ensure that your current working directory is the R package directory you cloned (
getwd()
to check andsetwd()
to change). - Run
devtools::load_all()
in the R console. You should seeℹ Loading browseMetadata
returned. - Test the function runs by running
domain_mapping()
in the R console. - Make your changes (or review changes made by others), and commit these changes in the way you choose to interact with git locally!
If you run into issues with branches not seeming to be up to date in the R Studio workspace, consider running remove.packages("browseMetadata")
and trying the above steps again, in case a previously installed package library is getting in the way somehow.
Working with Package Data
-
Creating .rda Files: To create
.rda
files in the data directory of the package, use the following command in R:usethis::use_data(dataname)
Replace
dataname
with the actual name of your data. -
Viewing Package Data: To view the data included in the
browseMetadata
package, execute:data(package='browseMetadata')
-
Loading Package Data: To load specific data from the package, use:
data(dataname)
Again, replace
dataname
with the name of the data you wish to load.
Building Documentation
-
Generating Documentation Files: To build the documentation files for the package, use the
roxygen2
package:This will generate the necessary documentation based on your roxygen comments in the R code.