data(mtcars) lm(mpg ~ hp, data = mtcars) lm(mpg ~I(hp^2), data = mtcars) lm(mpg ~I(hp^3), data = mtcars) lm(mpg ~I(hp^4), data = mtcars) lm(mpg ~I(hp^5), data = mtcars) lm(mpg ~I(hp^6), data = mtcars)To avoid doing this, one can write a function that builds the formulae: {{... [Read more...]
library(purrr) numbers <- list(11, 12, 13, 14) map_dbl(numbers, sqrt)
## [1] 3.316625 3.464102 3.605551 3.741657You might ... [Read more...]
library(purrr) numbers <- list(11, 12, 13, 14) map_dbl(numbers, sqrt)
## [1] 3.316625 3.464102 3.605551 3.741657You ... [Read more...]
Copyright © 2023 | MH Corporate basic by MH Themes