library(ggplot2) library(dplyr) library(stringr)
Data <- read.table(file.choose(), header = TRUE, sep = “) Data
ggplot(Data, aes(x = TPT)) + geom_histogram( binwidth = 1, boundary = 1, fill = “pink”, color = “black” ) + scale_x_continuous( breaks = seq(1, 9, by = 1), limits = c(1, 9) ) + labs( title = “TPT di Indonesia”, x = “TPT”, y = “Freq” ) + theme_classic() + theme( axis.text.x = element_text(angle = 0, hjust = 0.5), plot.title = element_text(hjust = 0.5, face = “bold”) )
ggplot(Data, aes(x = ““, y = TPT)) + geom_boxplot(fill =”red”) + labs( title = “Box Plot TPT Indonesia 2023”, x = ““, y =”TPT” ) + theme_minimal() + theme( plot.title = element_text(hjust = 0.5, face = “bold”) )
Data_Kalimantan <- Data %>% filter(str_starts(Provinsi, “KALIMANTAN”))
Data_Kalimantan
ggplot(Data_Kalimantan, aes(x = Provinsi, y = TPT, fill = Provinsi)) + geom_col() + labs( title = “TPT Pulau Kalimantan Tahun 2023”, x = “Provinsi”, y = “TPT” ) + theme_minimal() + theme( axis.text.x = element_text(angle = 45, hjust = 1), plot.title = element_text(hjust = 0.5, face = “bold”), legend.position = “none” )
```