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

Afg Arrows
Activity 3
Activity 3 : upload to Rpubs Completed for DATA101
Daniel Medlin HW1
HW1 Data 101
Interactive Data Visualization with Plotly
This presentation demonstrates an interactive Plotly visualization created in R Markdown using the Gapminder dataset. It explores the relationship between GDP per capita, life expectancy, and population across countries in 2007.
Activity 3 Data 101
activity 3
Intro R
Hidalgo County Hoon Map (Uninsured below 2x Poverty Threshold)
library(dplyr) library(stringr) library(sf) library(tmap) library(scales) rbind(load_variables(2023, "acs5", cache = TRUE) %>% .[,1:3], load_variables(2023, "acs5/profile", cache = TRUE), load_variables(2023, "acs5/subject", cache = TRUE), load_variables(2023, "acs5/cprofile", cache = TRUE)) %>% as.data.frame(.) ->all_acs_vars lrgv_24<- get_acs(geography = "tract", county = c("Hidalgo", "Cameron", "Willacy", "Starr"), table = "C27016", state = "TX", year = 2024, survey = "acs5", geometry = TRUE) %>% left_join(., all_acs_vars, by = c("variable"="name")) %>% separate_wider_delim(., cols = "label", delim = "!!", names_sep="", too_few = "align_start") %>% separate_wider_delim(., cols = "variable", delim = "_", names_sep="", too_few = "align_start") %>% mutate(variable2 = as.numeric(variable2)) lrgv_24 %>% filter(grepl("205.05; H|206; H|207.29; H|207.30; H;| 207.24; H", NAME)) %>% dplyr::select(NAME, geometry) %>% unique(.) %>% st_as_sf(.) %>% st_union(.) %>% st_boundary() -> hoon_boundary rbind(load_variables(2023, "acs5", cache = TRUE) %>% .[,1:3], load_variables(2023, "acs5/profile", cache = TRUE), load_variables(2023, "acs5/subject", cache = TRUE), load_variables(2023, "acs5/cprofile", cache = TRUE)) %>% as.data.frame(.) ->all_acs_vars lrgv_24<- get_acs(geography = "tract", county = c("Hidalgo", "Cameron", "Willacy", "Starr"), table = "C27016", state = "TX", year = 2024, survey = "acs5", geometry = TRUE) %>% left_join(., all_acs_vars, by = c("variable"="name")) %>% separate_wider_delim(., cols = "label", delim = "!!", names_sep="", too_few = "align_start") %>% separate_wider_delim(., cols = "variable", delim = "_", names_sep="", too_few = "align_start") %>% mutate(variable2 = as.numeric(variable2)) lrgv_24 %>% mutate(over_under = case_when( str_detect(label3, "1.00|1.38") ~ "UNDER", str_detect(label3, "2.00|4.00") ~ "OVER", TRUE ~ "SUMMARY_VAR")) %>% group_by(NAME, label5, over_under) %>% mutate(grouped_ests = sum(estimate)) %>% filter(variable2 != 1 & !is.na(label4) & !is.na(label5)) %>% ungroup() %>% dplyr::select(NAME, label5, over_under, grouped_ests, geometry) %>% unique() %>% group_by(NAME) %>% mutate(tract_est = sum(grouped_ests), pct = grouped_ests/tract_est) %>% ungroup() %>% filter(over_under != "OVER" & !is.na(pct)) %>% group_by(NAME) %>% mutate(pct_nocoverage = sum(pct) %>% scales::percent(.)) %>% filter(grepl("Hidalgo", NAME)) %>% mutate(pct_two = pct*100, pct = pct %>% scales::percent(.), ) %>% dplyr::rename(., `Tract Name`=1, `Insurance Coverage`=2, `Under 2.0x Poverty Threshold?`=3, `Number Uninsured`=4, `Tract Pop. Size`=6, `Percent Uninsured under 2.0x Threshold` = 7, `Percent Under 2.0x Poverty Threshold`=8, `Under 2.0x Poverty Threshold (%)`=9) %>% filter(grepl("No", `Insurance Coverage`)) %>% st_as_sf() %>% tm_shape() + tm_polygons( fill = "Under 2.0x Poverty Threshold (%)", fill_alpha = 0.35, popup.vars = c("Tract Name", "Percent Under 2.0x Poverty Threshold", "Percent Uninsured under 2.0x Threshold", "Number Uninsured", "Tract Pop. Size"), fill.scale = tm_scale_intervals( style = "jenks" )) + tm_shape(hoon_boundary) + tm_lines(col = "red") + tm_basemap("OpenStreetMap")
Nebo_Veg
landfire vegetation data, simplified/re-classified into main habitat classes
Plot
Week 1: Learn R and Python with Heatmaps
Nura Uddin's Learning R and Python with Heatmaps