context("get R2 from linear regression")
test_that("rsquared() works", {
x <- c(
0.47757278, 0.783686054, 0.67713684,
0.18449017, 0.525312408, 0.00814505,
0.41764717, 0.211036512, 0.31190996,
0.14312053
)
y <- c(
0.643053783, 0.7953037, 0.334161496,
0.529722084, 0.2850723, 0.796445325,
0.169789078, 0.49695294, 0.17196189,
0.871107961
)
expect_equal(rsquared(x, y), 0.0575, tolerance=1e-4)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.