R Histogram

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

Example

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

# Create a histogram
hist(data, main = "Histogram", xlab = "Values", ylab = "Frequency", col = "skyblue")

Use of attributes

We can use attributes to make a difference.
  1. main - The main title of the plot.
  2. col - Colors for each bar.
  3. border - sets the color of the borders around the bars.
  4. breaks - specifies the number of intervals (bins) in the histogram.

Example

data <- c(22, 30, 25, 40, 35, 28, 45, 50, 32, 38, 42, 27, 33, 29, 31)
hist(data, main = "Customized Histogram", xlab = "Values", ylab = "Frequency", col = "salmon", border = "black", breaks = 5)

Quick Recap - Topics Covered

R Histogram
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 js

Example 1 Example 2 Example 3 Example 4 Example 5


Quiz


FEEDBACK