Reshape from wide to long format
Diasorin %>%
pivot_longer(
everything(),
names_to = c("ID", "ID"),
names_pattern = "(.)()"
)
g2 <- function(x)
{round(c(MEAN=mean(x,na.rm=TRUE),MEDIAN=median(x,na.rm=TRUE),
MIN=min(x,na.rm=TRUE),MAX=max(x,na.rm=TRUE),
CV=100*sd(x)/mean(x),SD=sd(x,na.rm=TRUE)),1)}
summarize(value, by=low, FUN=g2)
Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'mean': object 'value' not found