Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify FUN used in by( ) or related apply( ) functions

In a by() function, I will use cor (correlation) to be the FUN there. However, I'd like to setup use="complete.obs" too.

I don't know how to pass this argument in the FUN = cor part.

For example,

by(data, INDICES=list(data$Age), FUN=cor)
like image 424
Leo5188 Avatar asked Dec 03 '22 06:12

Leo5188


1 Answers

probably

by(data, INDICES=list(data$Age), FUN=cor, use = "complete.obs")

will work.

the arguments to by are passed to FUN.

like image 159
kohske Avatar answered Dec 22 '22 04:12

kohske