I have an file in that one particular column I have 3 variables like supermarket, grocery & ball. I need to sum up all these names to find their total number how to do that with code in R language
Asked
Active
Viewed 23 times
0
-
It would be easier to help if you create a small reproducible example along with expected output. Read about [how to give a reproducible example](http://stackoverflow.com/questions/5963269). Is this what you want ? https://stackoverflow.com/questions/1660124/how-to-sum-a-variable-by-group – Ronak Shah Sep 29 '21 at 04:22
-
search on aggregate (for base R) or group_by (for tidyverse). This must be one of the mose frequently asked questions by new users of R. You should only [edit] your question if your searching is unsuccessful. – IRTFM Sep 29 '21 at 04:24
-
library(vcd) View(Arthritis) re=Arthritis%>% group_by(Improved)%>% summarise(new_col_improved=n()) View(re) use this function it will work especially to count all variables of a single column – ALEXANDER ABRAHAM Sep 29 '21 at 15:56