If I do:
dplyr::mutate(MeanValue = mean(RSSI), ReadCount = n())
everything works fine. But when I try to qualify the function:
dplyr::mutate(MeanValue = mean(RSSI), ReadCount = dplyr::n())
I get the error mentioned in the title.
So, I do not really have a problem, I can just avoid doing that, but I'm curious about why it even happens. I already looked at another question (dplyr: "Error in n(): function should not be called directly"), but as far as I know, dplyr is the only library I'm using. I tried doing what the answer suggests anyway, but
detach(package:plyr)
results in
Error in detach(package:plyr) : invalid 'name' argument and
conflicts()
does not mention n():
[1] "filter" "lag" "body<-" "intersect" "kronecker" "setdiff" "setequal" "union"
, most of which is cause by dplyr.
I guess I'm not the only one confused by this?
?n
works for me. – Roman Luštrikn
in dplyr seems to be mapped to an internal function whiledplyr::n
cannot be treated equally and just calls the -error giving- R function. – alexis_lazn
not as a R function but rather an argument tosummarize
,mutate
, etc. that gets passed along to the C functions that know how to interpret it. – Philippe Marchand