barplot.leem | R Documentation |
Class method leem for generic barplot
## S3 method for class 'leem'
barplot(
height,
freq = "a",
bg = TRUE,
main = NULL,
xlab = NULL,
ylab = NULL,
grids = grid(col = "white"),
bgcol = "gray",
bgborder = NA,
barcol = "yellow",
barborder = "gray",
posx1 = 0,
posx2 = 0,
xang = 0,
labels = NULL,
...
)
height |
R object (list) of class leem. Use |
freq |
Character argument. Type of frequency with options: |
bg |
Logical argument. Default is |
main |
Character argument. Insert the plot title. The default is |
xlab |
Character argument. Insert the title of the x-axis graphic label. The default is |
ylab |
Character argument. Insert the title of the y-axis graphic label. The default is |
grids |
Insert grids to plot. The default is |
bgcol |
Insert the background color. This argument is only valid when |
bgborder |
Character argument. Insert the background border color. This argument is only valid when |
barcol |
Character argument. Insert the barplot color. The default is |
barborder |
Numeric argument. Insert the barplot border color. This argument is only valid when |
posx1 |
Numeric argument.Distance of the labels (horizontal) in relation to the x axis. |
posx2 |
Numeric argument.Distance of the labels (vertical) in relation to the x axis. |
xang |
Numeric argument.Angle of the labels in relation to the x axis |
labels |
Character argument. Labels name vector. |
... |
further arguments passed to or from other methods. |
library(graphics)
# Example 1 - Simple example
library(leem)
rep(1:5, 5:1) |>
new_leem() |>
barplot()
# Example 2 - Color bars
rep(1:5, 5:1) |>
new_leem() |>
barplot(barcol = heat.colors(5))
# Example 3 - Ordered data
library(leem)
school <- rep(c("high", "university", "basic"), 3:5)
sample(school, 30, TRUE) |>
new_leem() |>
tabfreq(ordered = c("basic", "high", "university")) |>
barplot(xang = 15, posx2 = -0.2)
# Example 4 - Coerced to histogram
rnorm(100, 10, 2) |>
new_leem(variable = 2) |>
barplot(barcol = heat.colors(10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.