[mirror] Opinionated R package quickstart
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Some documentation

VisruthSK 5e34180d 26d5f9e9

+131
+4
NAMESPACE
··· 1 1 # Generated by roxygen2: do not edit by hand 2 2 3 + export(bootstrapper) 4 + export(create_package) 5 + export(pkg_setup) 6 + export(use_license)
+37
R/bootstrapper.R
··· 1 + #' Bootstrap a New R Package 2 + #' 3 + #' Create a package with some opinionated setup. 4 + #' 5 + #' @param path Path where the package should be created. Defaults to `"."` 6 + #' @param fields Named list of `DESCRIPTION` fields passed to 7 + #' [usethis::create_package()]. See [usethis::use_description()] 8 + #' @param private Whether to create the GitHub repository as private. Defaults to `TRUE`. 9 + #' @param ... Additional arguments passed to [usethis::create_package()]. 10 + #' 11 + #' @return Invisibly returns `NULL`. 12 + #' @export 1 13 bootstrapper <- function( 2 14 path = ".", 3 15 fields, ··· 9 21 invisible(NULL) 10 22 } 11 23 24 + #' Create a Package and Connect GitHub 25 + #' 26 + #' Create a package, apply `.Rbuildignore` cleanup, prompt for a license, and 27 + #' connect the package to GitHub. 28 + #' 29 + #' @inheritParams bootstrapper 30 + #' @return Invisibly returns `NULL`. 31 + #' @export 12 32 create_package <- function( 13 33 path = ".", 14 34 fields = getOption( ··· 49 69 invisible(NULL) 50 70 } 51 71 72 + #' Apply Opinionated Package Setup 73 + #' 74 + #' Run the package setup steps used by `bootstrapper`, including test 75 + #' infrastructure, README/NEWS creation, GitHub Actions, and linting defaults. 76 + #' 77 + #' @return Invisibly returns `NULL`. 78 + #' @export 52 79 pkg_setup <- function() { 53 80 tryCatch( 54 81 usethis::use_testthat(), ··· 110 137 111 138 # Helpers --------------------------------------------------------------------- 112 139 140 + #' Choose and Apply a License 141 + #' 142 + #' Prompts for a license choice in interactive sessions and applies the selected 143 + #' `usethis` license helper. 144 + #' 145 + #' @param author A [utils::person()] object used when the selected license 146 + #' requires a copyright holder. 147 + #' 148 + #' @return Invisibly returns `NULL`. 149 + #' @export 113 150 use_license <- function(author) { 114 151 license_choices <- c( 115 152 "MIT" = "use_mit_license",
+24
man/bootstrapper.Rd
··· 1 + % Generated by roxygen2: do not edit by hand 2 + % Please edit documentation in R/bootstrapper.R 3 + \name{bootstrapper} 4 + \alias{bootstrapper} 5 + \title{Bootstrap a New R Package} 6 + \usage{ 7 + bootstrapper(path = ".", fields, private = TRUE, ...) 8 + } 9 + \arguments{ 10 + \item{path}{Path where the package should be created. Defaults to \code{"."}} 11 + 12 + \item{fields}{Named list of \code{DESCRIPTION} fields passed to 13 + \code{\link[usethis:create_package]{usethis::create_package()}}. See \code{\link[usethis:use_description]{usethis::use_description()}}} 14 + 15 + \item{private}{Whether to create the GitHub repository as private. Defaults to \code{TRUE}.} 16 + 17 + \item{...}{Additional arguments passed to \code{\link[usethis:create_package]{usethis::create_package()}}.} 18 + } 19 + \value{ 20 + Invisibly returns \code{NULL}. 21 + } 22 + \description{ 23 + Create a package with some opinionated setup. 24 + }
+32
man/create_package.Rd
··· 1 + % Generated by roxygen2: do not edit by hand 2 + % Please edit documentation in R/bootstrapper.R 3 + \name{create_package} 4 + \alias{create_package} 5 + \title{Create a Package and Connect GitHub} 6 + \usage{ 7 + create_package( 8 + path = ".", 9 + fields = getOption("usethis.description", list(`Authors@R` = person("Visruth", 10 + "Srimath Kandali", , "public@visruth.com", role = c("aut", "cre", "cph"), comment = 11 + c(ORCID = "0009-0005-9097-0688")))), 12 + private = TRUE, 13 + ... 14 + ) 15 + } 16 + \arguments{ 17 + \item{path}{Path where the package should be created. Defaults to \code{"."}} 18 + 19 + \item{fields}{Named list of \code{DESCRIPTION} fields passed to 20 + \code{\link[usethis:create_package]{usethis::create_package()}}. See \code{\link[usethis:use_description]{usethis::use_description()}}} 21 + 22 + \item{private}{Whether to create the GitHub repository as private. Defaults to \code{TRUE}.} 23 + 24 + \item{...}{Additional arguments passed to \code{\link[usethis:create_package]{usethis::create_package()}}.} 25 + } 26 + \value{ 27 + Invisibly returns \code{NULL}. 28 + } 29 + \description{ 30 + Create a package, apply \code{.Rbuildignore} cleanup, prompt for a license, and 31 + connect the package to GitHub. 32 + }
+15
man/pkg_setup.Rd
··· 1 + % Generated by roxygen2: do not edit by hand 2 + % Please edit documentation in R/bootstrapper.R 3 + \name{pkg_setup} 4 + \alias{pkg_setup} 5 + \title{Apply Opinionated Package Setup} 6 + \usage{ 7 + pkg_setup() 8 + } 9 + \value{ 10 + Invisibly returns \code{NULL}. 11 + } 12 + \description{ 13 + Run the package setup steps used by \code{bootstrapper}, including test 14 + infrastructure, README/NEWS creation, GitHub Actions, and linting defaults. 15 + }
+19
man/use_license.Rd
··· 1 + % Generated by roxygen2: do not edit by hand 2 + % Please edit documentation in R/bootstrapper.R 3 + \name{use_license} 4 + \alias{use_license} 5 + \title{Choose and Apply a License} 6 + \usage{ 7 + use_license(author) 8 + } 9 + \arguments{ 10 + \item{author}{A \code{\link[utils:person]{utils::person()}} object used when the selected license 11 + requires a copyright holder.} 12 + } 13 + \value{ 14 + Invisibly returns \code{NULL}. 15 + } 16 + \description{ 17 + Prompts for a license choice in interactive sessions and applies the selected 18 + \code{usethis} license helper. 19 + }