Description Usage Arguments Details Value Examples
View source: R/expect_distfit.R
Expectation checking whether a given sample comes from Gaussian distribution with arbitrary parameters. The underlying procedure is Shapiro- Wilk's test of normality shapiro.test
.
The expectation throws an error when the test's p-value is smaller than the threshold p-value.
1 | expect_gaussian(sample, p_value = 0.001)
|
sample |
to test |
p_value |
threshold p-value of the test |
shapiro.test allows the number of non-missing values to be between 3 and 5000.
Invisibly returns a p-value of the test.
1 2 3 4 5 6 7 8 9 | x<-rnorm(n=1e3,5,6)
expect_gaussian(sample=x)
#The following test doesn't pass
## Not run:
x<-runif(n=1e2,-1,6)
expect_gaussian(sample=x)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.