Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
^renv$
^renv\.lock$
^LICENSE\.md$
^.*\.Rproj$
^\.Rproj\.user$
Expand All @@ -6,3 +8,4 @@
^docs$
^pkgdown$
^\.lintr$
^data-raw$
1 change: 1 addition & 0 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source("renv/activate.R")
8 changes: 4 additions & 4 deletions .github/workflows/BioC-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck, BiocManager

Expand Down
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: DevelExample
Title: A Basic R Package to Demonstrate a Cycle of Code Development
Version: 0.0.1
Version: 0.1.0
Authors@R:
person(given = "Joshua",
family = "Campbell",
Expand All @@ -15,10 +15,12 @@ Encoding: UTF-8
biocViews: Clustering
LazyData: false
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
RoxygenNote: 7.2.3
Suggests:
knitr,
rmarkdown,
testthat (>= 3.0.0)
Config/testthat/edition: 3
VignetteBuilder: knitr
Depends:
R (>= 2.10)
8 changes: 3 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Changes in Version 0.0.1 (2022-05-08)
* Created package
* Added Hello World function
* Added documentation, unit tests, and vignettes
* Added a `NEWS.md` file to track changes to the package.
# DevelExample 0.1.0

* Initial CRAN submission.
11 changes: 11 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#' Example dataset
#'
#' A dataset containing a matrix with two columns that were generated
#' with a random normal distribution with a mean of 0 and stdev of 1.
#'
#' @format A matrix with 100 rows and 2 columns
#' @keywords datasets
#' @usage data("example_data")
#' @examples
#' data("example_data")
"example_data"
19 changes: 19 additions & 0 deletions R/distance.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
euclideanDist <- function(a, b, verbose = FALSE) {
if (isTRUE(verbose)) {
message("Calculating distance ...")
}

# Check validity of data
.check_data(a)
.check_data(b)

# Perform calculation
res <- sqrt(sum((a-b)^2))
return(res)
}

.check_data <- function(input) {
if (any(is.na(input))) {
stop("'input' must not contain NAs")
}
}
4 changes: 4 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
url: ~
template:
bootstrap: 5

7 changes: 7 additions & 0 deletions data-raw/example_data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## code to prepare `example_data` dataset goes here
## code to prepare `example_data` dataset goes here
set.seed(123)
a <- rnorm(100)
b <- rnorm(100)
example_data <- cbind(a, b)
usethis::use_data(example_data, overwrite = TRUE)
Binary file added data/example_data.rda
Binary file not shown.
86 changes: 86 additions & 0 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading