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

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")
Word Chart
install.packages("wordcloud") library(wordcloud) words <- c("Data", "Visualization", "R", "Programming", "Analysis", "Statistics", "Charts", "Graphs") freq <- c(50, 40, 30, 25, 20, 15, 10, 5) wordcloud(words, freq, colors = brewer.pal(8, "Dark2"), main = "Word Cloud Example")
Line Plot
time <- c(1, 2, 3, 4, 5, 6) sales <- c(200, 220, 250, 300, 320, 350) plot(time, sales, type = "o", col = "red", main = "Line Plot: Sales Over Time", xlab = "Time (Months)", ylab = "Sales ($)") abline(lm(sales ~ time), col = "blue")
Scatter Plot
height <- c(160, 165, 170, 175, 180, 185) weight <- c(60, 65, 70, 75, 80, 85) plot(height, weight, col = "blue", pch = 19, main = "Scatter Plot: Height vs Weight", xlab = "Height (cm)", ylab = "Weight (kg)")
Pie Chart
market_share <- c(30, 25, 20, 15, 10) labels <- c("Company A", "Company B", "Company C", "Company D", "Others") pie(market_share, labels = labels, col = rainbow(length(labels)), main = "Pie Chart: Market Share")
Histogram
set.seed(123) data <- rnorm(1000, mean = 50, sd = 10) hist(data, breaks = 30, col = "lightgreen", main = "Histogram: Random Normal Distribution", xlab = "Values")
Plot
Prinsip Pengambilan Sample
Teknik Sampling dan Survei
BUS 350 Assignment 1
Plot
Plot