'Error in UseMethod("mutate") when trying to add another column at end of numeric data set that sums rows

I get: Error in UseMethod("mutate") : no applicable method for 'mutate' applied to an object of class "c('matrix', 'array', 'double', 'numeric'

computing column wise sum

library(dplyr) 
MMIp2.nona <- data.raw1.MMIp2.num %>% replace(is.na(.), 0) #works fine
MMIp2.summed <- MMIp2.nona %>% mutate(sum_of_rows = rowSums(.)) #gives error
r


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source