R Box plot

Create's a boxplot using the boxplot() function.
Syntax boxplot(data)


Example
# Example data
data <- c(22, 30, 25, 40, 35, 28, 45, 50, 32, 38, 42, 27, 33, 29, 31)

# Create a boxplot
boxplot(data, main = "Boxplot", ylab = "Values", col = "lightgreen", border = "black")

Use of attributes

We can use attributes to make a difference.

  1. main - The main title of the plot.
  2. col - Colors for each boxes.
  3. border - Color of the border around the boxes.
  4. notch = TRUE - adds a notch to the boxes for a confidence interval around the median.
Example
data <- c(22, 30, 25, 40, 35, 28, 45, 50, 32, 38, 42, 27, 33, 29, 31)

# Customized boxplot
boxplot(data, main = "Customized Boxplot", ylab = "Values", col = "lightblue", border = "darkblue", notch = TRUE)

Quick Recap - Topics Covered

R Box plot
Use of attributes

Practice With Examples in Compilers

The Concepts and codes you leart practice in Compilers till you are confident of doing on your own. A Various methods of examples, concepts, codes availble in our websites. Don't know where to start Down some code examples are given for this page topic use the code and compiler.


Example 1
Example 1 Example 2 Example 3 Example 4 Example 5


Quiz


FEEDBACK