Recently Published

ASSIGNMENT_6
test
test
Dendrogram of Countries Based on HDI (2022)
PAC 2: Dendrogram
Assignment 6
Number of Peace Agreements Signed Per Year
An example of unit charts.
Document
Document
API Assignment
The New York Times web site provides a rich set of APIs, as described here: https://developer.nytimes.com/apis You’ll need to start by signing up for an API key. Your task is to choose one of the New York Times APIs, construct an interface in R to read in the JSON data, and transform it into an R DataFrame. The api data I used from NY times was on books by Stephen King.
Plot
# Load ggplot2 library(ggplot2) # Create a contingency table and convert it to a data frame for ggplot contingency_table <- table(clinical_data$Smoking_Status, clinical_data$Diabetes) plot_data <- as.data.frame(contingency_table) colnames(plot_data) <- c("Smoking_Status", "Diabetes", "Count") # Plot ggplot(plot_data, aes(x = Smoking_Status, y = Count, fill = Diabetes)) + geom_bar(stat = "identity", position = "fill") + labs(title = "Proportion of Diabetes Status by Smoking Status", x = "Smoking Status", y = "Proportion") + scale_y_continuous(labels = scales::percent) + theme_minimal() + theme(legend.position = "top")
Plot
# Create a mosaic plot from the contingency table mosaicplot(contingency_table, main = "Mosaic Plot of Smoking Status and Diabetes", xlab = "Smoking Status", ylab = "Diabetes", color = TRUE)