-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Comment Josh's unit tests for DEqual()
- Loading branch information
1 parent
c936b18
commit eb6ff98
Showing
1 changed file
with
10 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
# Create a data frame 'random_de'. This data frame is created by: | ||
# 1. Generating a vector 't' with random t-distribution values. The 'rt' function is used to generate | ||
# these values, where 'nrow(degradation_tstats)' specifies the number of values and '5' is the degrees of freedom. | ||
# 2. Setting the row names of 'random_de' to a random sample of the row names from 'degradation_tstats'. | ||
# 'sample' function is used for sampling, and 'nrow(degradation_tstats)' gives the number of samples to draw. | ||
# 3. The data frame 'random_de' is then used as input for the function 'DEqual' to generate a ggplot object. | ||
random_de <- data.frame( | ||
t = rt(nrow(degradation_tstats), 5), | ||
row.names = sample(rownames(degradation_tstats), nrow(degradation_tstats)) | ||
) | ||
|
||
|
||
# Test that the output is a ggplot object | ||
test_that("output is a ggplot", { | ||
expect_equal(class(DEqual(random_de))[1], "gg") | ||
}) | ||
|
||
# Test that the output is a ggplot object | ||
test_that("output is a ggplot", { | ||
expect_equal(class(DEqual(random_de))[2], "ggplot") | ||
}) | ||
|
||
|