Code Monkey home page Code Monkey logo

packagetemplate_old's Introduction

{{ packagename }}

License: MIT R-CMD-check Codecov test coverage lifecycle-concept

{{ packagename }} provides functions to ….

{{ packagename }} is developed at the CENTER|similar at the UNIVERSITY|similar as part of the Epiverse-TRACE program.

Installation

You can install the development version of {{ packagename }} from GitHub with:

# install.packages("pak")
pak::pak("{{ gh_repo }}")

Example

These examples illustrate some of the current functionalities

Development

Lifecycle

This package is currently a concept, as defined by the RECON software lifecycle. This means that essential features and mechanisms are still being developed, and the package is not ready for use outside of the development team.

Contributions

Contributions are welcome via pull requests.

Code of Conduct

Please note that the {{ packagename }} project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Command line instructions: Create a new Github repository using a template

There’s a shortcut to this, which is provided here for people short on time, but the scenic route follows.

Github command line client

Install the Github command line client gh following the instructions for your OS here: https://github.com/cli/cli. Run gh auth login to link your device with your Github account the first time you use the CLI.

Once installed and authenticated, run:

gh repo create epiverse-trace/mypackage --public --template=epiverse-trace/packagetemplate

Clone the repository as usual using your preferred method.

Command line instructions: Create a repo and R package from scratch

Make an R project

Rscript -e 'devtools::create("mypackage")'

or

Rscript -e 'usethis::create_package("mypackage")'

Initialise a git repository

cd mypackage
git init

Create a remote Github repository

Github command line client

Install the Github command line client gh following the instructions for your OS here: https://github.com/cli/cli. Run gh auth login to link your device with your Github account the first time you use the CLI.

Create the package repository in the Epiverse TRACE organisation.

# still in mypackage
gh repo create epiverse-trace/mypackage

Initial commit to main

git push --set-upstream origin main

Get R-related .gitignore

Getting R.gitignore from https://github.com/github/gitignore, and renaming it to .gitignore.

wget is cross platform and should be available on most systems. Alternatives using curl exist.

wget https://raw.githubusercontent.com/github/gitignore/main/R.gitignore
mv R.gitignore .gitignore

Set up R package components

These next steps are from the R command line. If you are prompted to copy or edit text in the terminal (especially if you launched R from the terminal using $ R), you might be in Vim. Exit by typing :wq, and edit these files in a text editor.

  1. Populate fields in the DESCRIPTION and NAMESPACE
# e.g. using data.table
usethis::use_package("data.table")

Actually data.table requires a bit more configuration to use many of its features, such as := and .SD. Use instead:

usethis::use_data_table()
  1. Set up unit testing infrastructure
usethis::use_testthat()

# and a basic test file
usethis::use_test("basic-test")

# code coverage YAML for codecov
usethis::use_coverage("codecov")
  1. Set a licence

We prefer the MIT licence, primarily because it is short and easy to read.

usethis::use_mit_licence()
  1. Make a README page
usethis::use_readme_rmd()

Readme.md can be updated manually from the Readme.Rmd created above, using

devtools::build_readme()

or using a Github Actions setup (see the examples here https://github.com/r-lib/actions/tree/v2-branch/examples).

  1. Set up continuous integration using Github Actions
# to check package installation
usethis::use_github_actions_check_standard()

# to report code coverage results to codecov
usethis::use_github_action("test-coverage")
  1. Set up documentation
  1. Document the package as required using
devtools::document()
  1. Set up a pkgdown website.
# configure the pkgdown YAML.
# can be saved and edited later
usethis::use_pkgdown()

# build the website using
pkgdown::build_site()

Or set up a Github Actions job using usethis::use_github_action("pkgdown").

packagetemplate_old's People

Contributors

bisaloo avatar pratikunterwegs avatar avallecam avatar actions-user avatar joshwlambert avatar thibautjombart avatar bahadzie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.