plyr


Frequency table in R


I'm battling with something that I think should be so simple!
I have researched frequency tables in R and can't figure out what to do.
I have a data set with different questionnaires within this data set.
I.e., The first questionnaire is made up of 10 items, and I have a separate column for each item/variable, i.e. Question 1, Question 2, Question 3 etc will each have it's own column.
Within each column, there are 400 responses (i.e., participants) where each participant gives a response of 0,1, or 2.
All I want to do, is generate a frequency count on all variables (i.e., Question 1, Question 2, Question 3 etc) so that I get a summary for all variables - for example:
"Question 1"
0 = 100
1 = 200
2 = 97
NA = 3
Total = 400
How do I generate this in a simple, neat table?
df #the name of your raw table
table(df$columnName) #This command should create the table for you
if you also want to see a total on the end, you can do this:
exampleTable <- table(df$columnName)
exampleTable <- cbind(exampleTable, Total = rowSums(exampleTable))

Related Links

Likelihood over subgroups
Error in Changing Factors with PLYR in R
Frequency table in R
Installation of plyr in R on Ubuntu does not work
Issue installing library(plyr) in R (Windows)

Categories

HOME
cocoapods
matrix
angular-ui-grid
livecode
website
cryptography
moodle-api
swift2
gprs
scheduler
specifications
eddystone
elastic-load-balancer
log4j2
bootstrap-switch
ex
bundler
nest-api
bazaar
opam
anova
mime-types
amazon-sns
ini
vuforia
password-generator
cellular-network
beego
android-cardview
msdeploy
code-climate
django-import-export
bobo-browse.net
substance
nic
locks
snap-framework
universal
microsoft-certifications
xmlunit
serversocket
runtimeexception
stackpanel
cloudera-quickstart-vm
variable-variables
tidal-scheduler
assemblies
slideshow
yoast
reverse-dns
ipp-protocol
adblock
autorelease
xcglogger
photoswipe
phppgadmin
amazon-elastic-beanstalk
deviare
nclam
jpda
data-management
p6spy
noclassdeffounderror
odp.net-managed
processor
mercurial-extension
directx-9
netdatacontractserializer
knife
espresso
android-handler
text-align
microsoft-expression-web
thoughtworks-go
encryption-symmetric
symja
windows-rt
refit
boolean-algebra
ctp
jmenubar
acitree
sql-view
ember-table
jbox2d
android-authenticator
xmlwriter
playorm
workflow-manager-1.x
viewpagerindicator
pcspim
database-deadlocks
startupscript
cewolf
android-input-method
ppc
server-load

Resources

Encrypt Message