# Create sample data
x <- c(1, 2, 3, 4, 5)
y <- c(3, 5, 7, 2, 8)
# Create a new graphics device (window)
dev.new()
# Create a plot
plot(x, y, type = "o", main = "Line Chart", xlab = "X
axis", ylab = "Y-axis", col = "blue")
# Create a new graphics device
dev.new()
# Create a histogram
hist(x, main = "Histogram", xlab = "Value", ylab =
"Frequency", col = "lightgreen")
# Create a new graphics device
dev.new()
# Create a line chart
lines(x, y, type = "o", col = "red")
title(main = "Line Chart", xlab = "X-axis", ylab = "Y
axis")
# Create a new graphics device
dev.new()
# Create a pie chart
pie(x, labels = c("A", "B", "C", "D", "E"), main = "Pie
Chart")
# Create a new graphics device
dev.new()
# Create a boxplot
boxplot(x, main = "Boxplot", ylab = "Values", col =
"orange")
# Create a new graphics device
dev.new()
# Create a scatterplot
plot(x, y, main = "Scatterplot", xlab = "X-axis", ylab =
"Y-axis", col = "green", pch = 19)
0 Comments