On Mon, 4 Sep 2023, Ivan Calandra wrote:
Thanks Rui for your help; that would be one possibility indeed.
But am I the only one who finds that behavior of aggregate() completely
unexpected and confusing? Especially considering that dplyr::summarise() and
doBy::summaryBy() deal with NAs differe
Ivan:
Just one perhaps extraneous comment.
You said that you were surprised that aggregate() and group_by() did not
have the same behavior. That is a misconception on your part. As you know,
the tidyverse recapitulates the functionality of many base R functions; but
it makes no claims to do so in
Haha, got it now, there is an na.action argument (which defaults to
na.omit) to aggregate() which is applied before calling mean(na.rm =
TRUE). Thank you Rui for pointing this out.
So running it with na.pass instead of na.omit gives the same results as
dplyr::group_by()+summarise():
aggregate(
Às 12:51 de 04/09/2023, Ivan Calandra escreveu:
Thanks Rui for your help; that would be one possibility indeed.
But am I the only one who finds that behavior of aggregate() completely
unexpected and confusing? Especially considering that dplyr::summarise()
and doBy::summaryBy() deal with NAs d
Thanks Rui for your help; that would be one possibility indeed.
But am I the only one who finds that behavior of aggregate() completely
unexpected and confusing? Especially considering that dplyr::summarise()
and doBy::summaryBy() deal with NAs differently, even though they all
use mean(na.rm
Às 10:44 de 04/09/2023, Ivan Calandra escreveu:
Dear useRs,
I have just stumbled across a behavior in aggregate() that I cannot
explain. Any help would be appreciated!
Sample data:
my_data <- structure(list(ID = c("FLINT-1", "FLINT-10", "FLINT-100",
"FLINT-101", "FLINT-102", "HORN-10", "HORN
no missing data.
>
> Iago
>
> *De:* R-help de part de Ivan Calandra
>
> *Enviat el:* dilluns, 4 de setembre de 2023 11:44
> *Per a:* R-help
> *Tema:* [R] aggregate formula - differing results
> Dear useRs,
&g
has no missing data.
Iago
De: R-help de part de Ivan Calandra
Enviat el: dilluns, 4 de setembre de 2023 11:44
Per a: R-help
Tema: [R] aggregate formula - differing results
Dear useRs,
I have just stumbled across a behavior in aggregate() that I cannot
explain
Dear useRs,
I have just stumbled across a behavior in aggregate() that I cannot
explain. Any help would be appreciated!
Sample data:
my_data <- structure(list(ID = c("FLINT-1", "FLINT-10", "FLINT-100",
"FLINT-101", "FLINT-102", "HORN-10", "HORN-100", "HORN-102", "HORN-103",
"HORN-104"), Edge
9 matches
Mail list logo