R GraphicsLesson 28Free preview
R Bars
This lesson is part of R · All levels
Summary
This lesson reviews the bar chart in R using the barplot() function. A bar diagram is very effective for comparing the magnitude of values between different categories. Developers will study the making of vertical and horizontal bar diagrams, stacked bar diagrams, and grouped bar diagrams.
Key points
- The 'barplot(tinggi)' function creates a bar diagram of a vector or data matrix
- The 'names.arg' argument gives a label name to each stem
- The 'horizontal' argument transforms the diagram into a horizontal bar
- If the input is a matrix, the 'beside = TRUE' argument will produce a grouped barplot
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.