I'd like to count the number of recurring numerical variables in a given column. My data set is: mydata
And I have a dataframe that looks like this:
mydata <- structure(list(VARIABLE = c(1, 1, 2, 3, 3, 3, 4, 4)),
.Names = "VARIABLE", row.names = c(NA, -8L), class = "data.frame")
mydata
## VARIABLE
## 1 1
## 2 1
## 3 2
## 4 3
## 5 3
## 6 3
## 7 4
## 8 4
I'd like to calculate the number of 1s,2s,3s,4s in column VARIABLE
(Two 1, One 2, Three 3, Two 4). Is there anyway I can do this without installing an additional package?