Skip to content

Karim-Mane/test

Repository files navigation

test

Codecov test coverage

The goal of test is to provide functions that are useful for the creation of an R package.

Installation

You can install the development version of test from GitHub with:

# install.packages("devtools")
devtools::install_github("Karim-Mane/test")

Loading the package after installation

library(test)

Create an R project and link it with a remote GitHub account

The createPackage() function is used to create an R project and link it to a remote GitHub account and perform the first commit to that account. The function requires the following parameters:

  1. package.name: the name of the package/project to be created
  2. where: the path to the directory where package will be created
  3. organisation.name: the name of the organisation in which the package will be created. For Epiverse TRACE, this will be epiverse-trace. For Karim’s github account, this will be Karim-Mane
createPackage(package.name="test", 
              where="/Users/km28/Documents/Karim/Karim/LSHTM/Codes",
              organisation.name="Karim-Mane")

Set up the package components

Use the setUpPackageComponents() to set up the package components i.e. to: * set up a licence,
* create a Readme file,
* set up unit testing infrastructure,
* set up a pkgdown website,

setUpPackageComponents()

Build and update the Readme.md from the README.Rmd

To build the Readme.md file from the README.Rmd file, use the updateReadMe(). This function needs to be called after any modification of the README.Rmd file.

updateReadMe()

Build the package website

The package website can be built using the pkgdown package in R. After editing all your functions and documentation files, use the buildPkgdownWebsite() function to build the website.

buildPkgdownWebsite()

Add list of package dependencies

Once identified, the list of packages on which the current package depends on can will be added to the DESCRIPTION file using the addPkgDepencies() function. The function expects the following parameters:

  1. dependencies: a vector of packages on which the package to be built depends on
addPkgDepencies(dependencies=c("devtools","usethis","pkgdown","covr"))

Build the package documentation

When you are satisfied with the documentation of all the functions, use the buildPkgDocumentation() to build the documentation files in the man/ folder and update the NAMESPACE file.

buildPkgDocumentation()

Commit and push the changes to the remote GitHub account

For any changes/updates made on any of the files of the package use the command below to update the remote GitHub account.

git add .
git commit -a -m "updates"
git push origin master

About

steps to follow for creation of R package

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages