RPubs will retire in June 2027. Your existing documents will stay accessible through December 31, 2031
and Connect Cloud is the recommended home for new publishing. Read the blog post

Recently Published

Scatter plot for Fruit Sales
library(ggplot2) ggplot(fruit_data, aes(x = Fruit, y = Sales)) + geom_point(size = 4, color = "red") + labs(title = "Fruit Sales (Scatter Plot)", x = "Fruit", y = "Sales Count")
Document
Student Survey Data Frame
Publish Document
Radar 3
data <- data.frame( Communication = c(5, 4, 3, 2, 1), Teamwork = c(4, 5, 2, 3, 1), ProblemSolving = c(3, 4, 5, 2, 1), Creativity = c(2, 3, 4, 5, 1) ) data <- rbind(rep(5, 4), rep(0, 4), data) radarchart(data, title = "Radar Chart: Employee Performance", pcol = "purple", pfcol = rgb(0.5, 0, 0.5, 0.3), plwd = 2)
Radar 2
data <- data.frame( Product1 = c(5, 4, 3, 2, 1), Product2 = c(4, 5, 2, 3, 1), Product3 = c(3, 4, 5, 2, 1) ) data <- rbind(rep(5, 3), rep(0, 3), data) radarchart(data, title = "Radar Chart: Comparing Products", pcol = c("blue", "red", "green"), pfcol = c(rgb(0, 0, 1, 0.3), rgb(1, 0, 0, 0.3), rgb(0, 1, 0, 0.3)), plwd = 2)
Radar Chart 1
install.packages("fmsb") library(fmsb) data <- data.frame( Speed = c(5, 4, 3, 2, 1), Durability = c(4, 5, 2, 3, 1), Reliability = c(3, 4, 5, 2, 1), Efficiency = c(2, 3, 4, 5, 1) ) data <- rbind(rep(5, 4), rep(0, 4), data) radarchart(data, title = "Radar Chart: Product Attributes", pcol = "blue", pfcol = rgb(0, 0, 1, 0.3), plwd = 2)
Map (US)
us_map <- map_data("state") ggplot(us_map, aes(x = long, y = lat, group = group)) + geom_polygon(fill = "lightgreen", color = "black") + theme_minimal() + ggtitle("US State Map Example")
Document
Maps
install.packages("maps") install.packages("ggplot2") library(maps) library(ggplot2) world_map <- map_data("world") ggplot(world_map, aes(x = long, y = lat, group = group)) + geom_polygon(fill = "lightblue", color = "black") + theme_minimal() + ggtitle("World Map Example")
Box Plot
set.seed(123) group1 <- rnorm(100, mean = 70, sd = 10) group2 <- rnorm(100, mean = 80, sd = 15) group3 <- rnorm(100, mean = 60, sd = 5) boxplot(group1, group2, group3, names = c("Group 1", "Group 2", "Group 3"), col = "orange", main = "Box Plot: Exam Scores by Group")
Waffle chart
install.packages("waffle") library(waffle) parts <- c(30, 20, 15, 35) waffle(parts, rows = 5, colors = c("red", "blue", "green", "yellow"), title = "Waffle Chart: Distribution")
Radar Chart
install.packages("fmsb") library(fmsb) data <- data.frame( Speed = c(5, 4, 3, 2, 1), Durability = c(4, 5, 2, 3, 1), Reliability = c(3, 4, 5, 2, 1), Efficiency = c(2, 3, 4, 5, 1) ) radarchart(data, title = "Radar Chart: Product Attributes")