mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 04:02:19 +02:00
kurtosis, skewness, start with ML
This commit is contained in:
@ -49,5 +49,9 @@ test_that("frequency table works", {
|
||||
# input must be freq tbl
|
||||
expect_error(septic_patients %>% top_freq(1))
|
||||
|
||||
# charts from plot and hist, should not raise errors
|
||||
plot(freq(septic_patients, age))
|
||||
hist(freq(septic_patients, age))
|
||||
|
||||
})
|
||||
|
||||
|
13
tests/testthat/test-kurtosis.R
Normal file
13
tests/testthat/test-kurtosis.R
Normal file
@ -0,0 +1,13 @@
|
||||
context("kurtosis.R")
|
||||
|
||||
test_that("kurtosis works", {
|
||||
expect_equal(kurtosis(septic_patients$age),
|
||||
6.423118,
|
||||
tolerance = 0.00001)
|
||||
expect_equal(unname(kurtosis(data.frame(septic_patients$age))),
|
||||
6.423118,
|
||||
tolerance = 0.00001)
|
||||
expect_equal(kurtosis(matrix(septic_patients$age)),
|
||||
6.423118,
|
||||
tolerance = 0.00001)
|
||||
})
|
13
tests/testthat/test-skewness.R
Normal file
13
tests/testthat/test-skewness.R
Normal file
@ -0,0 +1,13 @@
|
||||
context("skewness.R")
|
||||
|
||||
test_that("skewness works", {
|
||||
expect_equal(skewness(septic_patients$age),
|
||||
-1.637164,
|
||||
tolerance = 0.00001)
|
||||
expect_equal(unname(skewness(data.frame(septic_patients$age))),
|
||||
-1.637164,
|
||||
tolerance = 0.00001)
|
||||
expect_equal(skewness(matrix(septic_patients$age)),
|
||||
-1.637164,
|
||||
tolerance = 0.00001)
|
||||
})
|
Reference in New Issue
Block a user