apologies in advance I am a beginner to R. I have loaded a CVS file into a new data frame - One of the columns provides a category number (from 1 to 6).I want to create a loop to count the number of times each category number appears , and then store this within a new data frame. (The new data frame would be the category number and how many times it appears) I have created the below script so far however unsure how to store the results within the new data frame and include the category number.
Summarydf<-NULL
unique<-c(unique(Data$Type))
for (i in unique) {
Summarydf<-c(sum(Data$Type==i))
print(Summarydf)
}