Nothing
test_that("summary methods work properly", {
xval <- 1.1:10.1
xerr <- rep(0.05, 10)
xval[c(2, 9)] <- c(1.102, 10.098)
xerr[c(2, 9)] <- 0.1
x <- set_errors(xval, xerr)
y <- 0
for (i in 1:length(x)) y <- y + x[i]
expect_equal(sum(x), y)
y <- 1
for (i in 1:length(x)) y <- y * x[i]
expect_equal(prod(x), y)
expect_equal(max(x), max(xval + xerr))
expect_equal(min(x), min(xval - xerr))
expect_equal(range(x)[1], min(x))
expect_equal(range(x)[2], max(x))
expect_equal(mean(x), set_errors(mean(xval), sd(xval)/sqrt(length(x))))
expect_equal(mean(set_errors(xval, xerr*100)), set_errors(mean(xval), mean(xerr*100)))
expect_equal(weighted.mean(x), set_errors(weighted.mean(xval), sd(xval)/sqrt(length(x))))
expect_equal(weighted.mean(set_errors(xval, xerr*100)), set_errors(weighted.mean(xval), weighted.mean(xerr*100)))
expect_equal(median(x), set_errors(median(xval), 1.253 * errors(mean(x))))
expect_equal(quantile(x), quantile(xval))
expect_equal(summary(x), summary(xval))
})
test_that("na.rm is propagated", {
xval <- 1.1:10.1
xval[1] <- NA
xerr <- rep(0.05, 10)
xerr[3] <- NA
xval[c(2, 9)] <- c(1.102, 10.098)
xerr[c(2, 9)] <- 0.1
x <- set_errors(xval, xerr)
expect_equal(max(x, na.rm=TRUE), max(xval + xerr, na.rm=TRUE))
expect_equal(min(x, na.rm=TRUE), min(xval - xerr, na.rm=TRUE))
expect_equal(range(x, na.rm=TRUE)[1], min(x, na.rm=TRUE))
expect_equal(range(x, na.rm=TRUE)[2], max(x, na.rm=TRUE))
expect_equal(mean(x, na.rm=TRUE), mean(x[-c(1, 3)]))
expect_equal(weighted.mean(x, na.rm=TRUE), weighted.mean(x[-c(1, 3)]))
expect_equal(median(x, na.rm=TRUE), median(x[-c(1, 3)]))
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.