generated from UofUEpiBio/egpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding my tests and finshining the lab UofUEpiBio/PHS7045-advanced-pr…
- Loading branch information
Showing
11 changed files
with
91 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(myplot) | ||
export(rcpp_hello_world) | ||
import(graphics) | ||
importFrom(Rcpp,evalCpp) | ||
useDynLib(egpkg, .registration = TRUE) | ||
useDynLib(egpkg2024, .registration = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#' @importFrom Rcpp evalCpp | ||
#' @useDynLib egpkg, .registration = TRUE | ||
#' @useDynLib egpkg2024, .registration = TRUE | ||
NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#' Here is the function | ||
#' @param x A numeric vector. | ||
#' @param y A numeric vector. | ||
#' @export | ||
#' @import graphics | ||
#' @examples | ||
#' # Here is an example | ||
#' set.seed(312) | ||
#' x <- rnorm(100) | ||
#' y <- rnorm(100) | ||
#' myplot(x, y) | ||
myplot <- function(x, y) { | ||
|
||
if (!is.numeric(x) | !is.numeric(y)) { | ||
stop("x and y must be numeric") | ||
} | ||
|
||
graphics::plot(x, y, col = "blue", pch = 19, cex = 2) | ||
|
||
invisible( | ||
list( | ||
x = x, | ||
y = y | ||
) | ||
) | ||
|
||
} | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file is part of the standard setup for testthat. | ||
# It is recommended that you do not modify it. | ||
# | ||
# Where should you do additional test configuration? | ||
# Learn more about the roles of various files in: | ||
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview | ||
# * https://testthat.r-lib.org/articles/special-files.html | ||
|
||
library(testthat) | ||
library(egpkg2024) | ||
|
||
test_check("egpkg2024") |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
test_that("multiplication works", { | ||
|
||
expect_error(myplot(1, "o")) | ||
expect_error(myplot("a", 1)) | ||
# expect_s3_class(myplot(1,1), "list") | ||
expect_silent(myplot(1,1)) | ||
|
||
}) |