0

Suppose I have a data frame with two attributes x and y: x<-c(909,446,563,56,888)and y<-c(676,353,242,181,780) Now, I'm trying to use dplyr to create a third column xy with entries that are the averages of x and y at each data point. I have the following code to obtain the third variable:

df %>%
  dplyr::summarize(Mean = mean(x,y, na.rm=TRUE))

However, I am not getting what I expect. Kindly assit.

0 Answers0