search for: map_dbl

Displaying 4 results from an estimated 4 matches for "map_dbl".

2019 Sep 23
2
help: boxplot multivariables
Hola, estoy tratando de hacer un boxplot para compara diferentes comportamientos. Tengo un set de datos con 17 columnas, quiero crear un boxplot considerando 3 de ellas. He buscado en foros y siempre responden esta pregunta con subconjuntos de datos dentro de una misma columna, y no he logrado realizarlo. Este es un ejemplo de mis datos: ID: id animal EP: episodio AA: acostado y alerta AD:
2020 Apr 16
2
suggestion: "." in [lsv]apply()
.../Henrik On Thu, Apr 16, 2020 at 9:30 AM Michael Mahoney <mike.mahoney.218 at gmail.com> wrote: > > This syntax is already implemented in the {purrr} package, more or > less -- you need to add a tilde before your function call for it to > work exactly as written: > > purrr::map_dbl(split(mtcars, mtcars$cyl), ~ summary(lm(wt ~ mpg, .))$r.squared) > > is equivalent to > > sapply(split(mtcars, mtcars$cyl), function(d) summary(lm(mpg ~ wt, > d))$r.squared) > > Seems like using this package is probably an easier solution for this > wish than adding a reserv...
2020 Apr 16
0
suggestion: "." in [lsv]apply()
This syntax is already implemented in the {purrr} package, more or less -- you need to add a tilde before your function call for it to work exactly as written: purrr::map_dbl(split(mtcars, mtcars$cyl), ~ summary(lm(wt ~ mpg, .))$r.squared) is equivalent to sapply(split(mtcars, mtcars$cyl), function(d) summary(lm(mpg ~ wt, d))$r.squared) Seems like using this package is probably an easier solution for this wish than adding a reserved variable and adding additional syn...
2020 Apr 16
6
suggestion: "." in [lsv]apply()
Hi, I would like to make a suggestion for a small syntactic modification of FUN argument in the family of functions [lsv]apply(). The idea is to allow one-liner expressions without typing "function(item) {...}" to surround them. The argument to the anonymous function is simply referred as ".". Let take an example. With this new feature, the following call