This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Functional Programming | |
# ID529 | |
# Topics to cover | |
# | |
# - sapply, apply family | |
# - purrr::map | |
# - summarize | |
# - stratified models | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Let's Review | |
# We circulated a survey about what would be the most useful material for us to | |
# review and revisit, as well as if there are any questions that would be useful | |
# for us to go over together. | |
# Overall topics to try to cover: | |
# | |
# - dplyr and data manipulation | |
# - color in ggplot2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ID529 Core Concepts Script | |
# This script covers the following skills: | |
# - Installing packages | |
# - Reading csv data in with readr::read_csv | |
# - Using dplyr for group_by and summarize | |
# - Creating factors, setting reference levels | |
# - Creating plots with ggplot2 and saving them | |
# - Fitting a model | |
# - Reporting on a model with gtsummary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Create Encrypted Files | |
create_encrypted_height_weight_medications <- function() { | |
# load files to be encrypted | |
dfs <- | |
list( | |
file1 = "sensitive_data/file1.xlsx", | |
file2 = "sensitive_data/file2.xlsx", | |
file3 = "sensitive_data/file3.xlsx" | |
) %>% purrr::map(readxl::read_excel) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(raster) | |
library(sf) | |
library(mapview) | |
library(janitor) | |
library(tidyverse) | |
library(RColorBrewer) | |
# google: get shapefiles for states of india in r | |
# results: | |
# - https://rstudio-pubs-static.s3.amazonaws.com/435552_5656a7fe6636474fb0f8d4222d79db2c.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
msg | X1 | X2 | |
---|---|---|---|
msg1 | 0.0324862346463363 | 0.69194085852225 | |
msg1 | 0.0394920482026479 | 0.677489436905826 | |
msg1 | 0.0416296060991105 | 0.654030226700252 | |
msg1 | 0.0438267683185091 | 0.638065001399384 | |
msg1 | 0.0468689114781872 | 0.258300797649034 | |
msg1 | 0.0479669631512071 | 0.682763302896725 | |
msg1 | 0.0481195790287829 | 0.233654583287701 | |
msg1 | 0.0498138500635324 | 0.62289798488665 | |
msg1 | 0.0496950444726811 | 0.279729219143577 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1e-04 | 0.593445948405704 | |
---|---|---|
1e-04 | 0.580335382791219 | |
1e-04 | 0.56737126037494 | |
1e-04 | 0.516979202691876 | |
0.000181832713359549 | 0.593445948405704 | |
0.000181832713359549 | 0.56737126037494 | |
0.000181832713359549 | 0.554553581156866 | |
0.000181832713359549 | 0.516979202691876 | |
0.000287949410139229 | 0.593445948405704 | |
0.000287949410139229 | 0.554553581156866 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-0.1137452711223203 | 0.8618811881188119 | |
---|---|---|
-0.1137452711223203 | 0.849009900990099 | |
-0.1137452711223203 | 0.8361386138613861 | |
-0.1137452711223203 | 0.8232673267326732 | |
-0.1137452711223203 | 0.8103960396039603 | |
-0.1137452711223203 | 0.7975247524752475 | |
-0.1137452711223203 | 0.7846534653465346 | |
-0.1137452711223203 | 0.7717821782178218 | |
-0.1137452711223203 | 0.7589108910891089 | |
-0.1137452711223203 | 0.6559405940594059 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(sf) | |
library(ggplot2) | |
nc <- st_read(system.file("shapes/sids.shp", package="spData")[1], quiet=TRUE) | |
nc %>% | |
ggplot(aes(fill = AREA)) + | |
geom_sf(size = 0.05, color = 'white') + | |
scale_fill_gradientn( | |
colors = c("#DA8907", "#ECCD00", "white", "#62AEDC", "#203856")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dependencies | |
library(tidycensus) | |
library(leaflet) | |
library(magrittr) | |
library(dplyr) | |
library(tidyr) | |
library(stringr) | |
library(ggplot2) | |
library(leafpop) | |
library(mapview) |
NewerOlder