I am trying to replace the values ββin a data frame with frequency.
Here are my details:
blah<-list(c(1,1,2,2,3,1,3,2,2,5,5), c(7,8,7,8,9,9,7,8,9,7,7)) blah<-as.data.frame(blah) colnames(blah)<-c("col1","col2")
I created a table with two columns.
Next, I use the βtableβ to generate the frequency for both columns:
col1Freq<-table(blah[,1])/dim(blah)[1] col2Freq<-table(blah[,2])/dim(blah)[1]
My goal is to replace all blah values ββwith frequencies. So, the final table should be the same size as blah, but I want frequencies instead of integers.
Sorry, I do not have photos to show .... Thanks for your help !!!!