0

I am trying to aggregate with the reactable package using ASP <- reactable::colDef(aggregate = 'mean') but it returns NAs because one of the rows has an NA.

Is there a way to tell reactable::colDef() to ignore the NA values and calculate the mean with the non-NA values?

xilliam
  • 2,074
  • 2
  • 15
  • 27

1 Answers1

0

This worked for me:

ASP = colDef(
footer = function(values) {
mean(na.omit(values))
}
)

For reference, I specified "NA" for missing values in my data frame.

Kate
  • 1