I'm trying to adjust a function I've written to explicitly call on other packages using "::", e.g., dplyr::mutate
. However, adding the "::" doesn't work for the pipe operator %>%
. How do I call on that?
This does not work:
DF <- data.frame(A = LETTERS[1:4],
B = 1:4) magrittr::%>%
dplyr::mutate(C = 5)
The error I receive is "Error in mutate_(.data, .dots = compat_as_lazy_dots(...)) :
argument ".data" is missing, with no default", so I think that means it's not getting the input of the left-hand data.frame to pipe into the function mutate
.