From 283b175baa5166ccd0d60bd082dca4e42f7a5867 Mon Sep 17 00:00:00 2001 From: Ben Bond-Lamberty Date: Fri, 2 Feb 2024 07:01:18 -0500 Subject: [PATCH] Documentation, testing, README (#1) --- DESCRIPTION | 9 +++++++-- NAMESPACE | 4 +++- R/hello.R | 9 ++++++++- README.md | 27 +++++++++++++++++++++++++++ man/hello.Rd | 9 +++++++-- tests/testthat/test-hello.R | 3 +++ whattheflux.Rproj | 1 + 7 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 README.md create mode 100644 tests/testthat/test-hello.R diff --git a/DESCRIPTION b/DESCRIPTION index 4770594..1b388c9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,13 +2,18 @@ Package: whattheflux Type: Package Title: What the Package Does (Title Case) Version: 0.1.0 -Author: Who wrote it -Maintainer: The package maintainer +Authors@R: c( + person("Ben", "Bond-Lamberty", email = "bondlamberty@pnnl.gov", + role = "aut", comment = c(ORCID = "0000-0001-9525-4633")), + person("Stephanie", "Wilson", email = "wilsonsj@si.edu", + role = "cre", comment = c(ORCID = "0000-0002-5484-0748"))) Description: More about what it does (maybe more than one line) Use four spaces when indenting paragraphs within the Description. +URL: https://compass.pnnl.gov License: MIT + file LICENSE Encoding: UTF-8 LazyData: true Suggests: testthat (>= 3.0.0) Config/testthat/edition: 3 +RoxygenNote: 7.2.3 diff --git a/NAMESPACE b/NAMESPACE index d75f824..01843dc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1 +1,3 @@ -exportPattern("^[[:alpha:]]+") +# Generated by roxygen2: do not edit by hand + +export(hello) diff --git a/R/hello.R b/R/hello.R index 3d348f2..c4f2a5f 100644 --- a/R/hello.R +++ b/R/hello.R @@ -1,6 +1,6 @@ # Hello, world! # -# This is an example function named 'hello' +# This is an example function named 'hello' # which prints 'Hello, world!'. # # You can learn more about package authoring with RStudio at: @@ -13,6 +13,13 @@ # Check Package: 'Cmd + Shift + E' # Test Package: 'Cmd + Shift + T' +#' hello +#' +#' @return Nothing, just prints hello +#' @export +#' +#' @examples +#' hello() hello <- function() { print("Hello, world!") } diff --git a/README.md b/README.md new file mode 100644 index 0000000..3546c89 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ + +# whattheflux + + +[![R-CMD-check](https://github.com/COMPASS-DOE/whattheflux/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/COMPASS-DOE/whattheflux/actions/workflows/R-CMD-check.yaml) + + +The goal of whattheflux is to ... + +## Installation + +You can install the development version of whattheflux from [GitHub](https://github.com/) with: + +``` r +# install.packages("devtools") +devtools::install_github("COMPASS-DOE/whattheflux") +``` + +## Example + +This is a basic example which shows you how to solve a common problem: + +``` r +library(whattheflux) +## basic example code +``` + diff --git a/man/hello.Rd b/man/hello.Rd index 0fa7c4b..70f2343 100644 --- a/man/hello.Rd +++ b/man/hello.Rd @@ -1,11 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/hello.R \name{hello} \alias{hello} -\title{Hello, World!} +\title{hello} \usage{ hello() } +\value{ +Nothing, just prints hello +} \description{ -Prints 'Hello, world!'. +hello } \examples{ hello() diff --git a/tests/testthat/test-hello.R b/tests/testthat/test-hello.R new file mode 100644 index 0000000..8849056 --- /dev/null +++ b/tests/testthat/test-hello.R @@ -0,0 +1,3 @@ +test_that("multiplication works", { + expect_equal(2 * 2, 4) +}) diff --git a/whattheflux.Rproj b/whattheflux.Rproj index 497f8bf..f0d6187 100644 --- a/whattheflux.Rproj +++ b/whattheflux.Rproj @@ -18,3 +18,4 @@ StripTrailingWhitespace: Yes BuildType: Package PackageUseDevtools: Yes PackageInstallArgs: --no-multiarch --with-keep.source +PackageRoxygenize: rd,collate,namespace,vignette