bar chart - Sum Barplot of a dataset in R -
lets have csv dataset 100 columns , 200 rows.
every row observation , columns questions measured on likert scale(categorical) 1-5.
now want make one barplot frequency on y-axis , categories 1-5 on x-axis. in end want have clean overview of categories have been used or least without further detail.
sorry, must super easy, if search solutions super fancy multiple or stacked barplots.
so basically, if * defined columns need like:
barplot(dataset$*)
additional comment:
when aksed questions code above worked 1 column f.e.
barplot(dataset$column1)
then played bit around , frequency on x-axis , looks weird way, same code. how possible?
if change code to:
barplot(xtabs(~dataset$column1))
i same result before:
barplots of 2 sets
x <- c(0.0001, 0.0059, 0.0855, 0.9082) y <- c(0.54, 0.813, 0.379, 0.35) # create 2 row matrix x , y height <- rbind(x, y) # use height , set 'beside = true' pairs # save bar midpoints in 'mp' # set bar pair labels a:d mp <- barplot(height, beside = true, ylim = c(0, 1), names.arg = letters[1:4]) #height must matrix mp <- barplot(height, beside = true) # draw bar values above bars text(mp, height, labels = format(height, 4), pos = 3, cex = .75)
Comments
Post a Comment