Reputation: 623
I'm trying to divide two columns both containing NA's, but can't make it work.
I've tried this:
df%>%
mutate(c_n = c / n, na.rm = TRUE)
All help is much appreciated!
Upvotes: 0
Views: 1781
Reputation: 26218
Use simply
df%>%
mutate(c_n = c / n)
NAs will automatically be left as they are
Upvotes: 2
Reputation: 101064
If you would like to keep NA
s, you can try
df %>%
mutate(c_n = C / N)
Upvotes: 1