0

I have a data frame that contains a column of numbers. I am trying to add those numbers together through the mutate function so that I can create a new variable containing the total sum of those numbers, and then add that new variable onto the end of my existing data frame.

I am trying to use the following line of code:

library(dplyr)

mutate(total_sum = sum(orders$numbers))

But when I run that line of code I get the following error:

Error in mutate_(.data, .dots = compat_as_lazy_dots(...)) : 
  argument ".data" is missing, with no default

What is causing this error and how can I fix it? My data frame is called orders but the column I want to add is called numbers.

www
  • 38,575
  • 12
  • 48
  • 84
A.Coder47
  • 15
  • 3

0 Answers0