This file contains hidden or 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(tidyverse) | |
# https://github.com/rfordatascience/tidytuesday/tree/master/data/2020/2020-03-24 | |
# Get the Data | |
tbi_age <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-24/tbi_age.csv') | |
tbi_year <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-24/tbi_year.csv') | |
tbi_military <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-24/tbi_military.csv') | |
This file contains hidden or 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(rvest) | |
library(dplyr) | |
library(stringr) | |
library(purrr) | |
session <- html_session("http://insideairbnb.com/get-the-data.html") | |
all_downloads <- session %>% | |
html_nodes("table.table-hover.table-striped.boston a") |
This file contains hidden or 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
/* rs-theme-name: Keeping Warm */ | |
/* rs-theme-is-dark: TRUE */ | |
/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: 66e611c4-a4d0-4887-ae0e-c646bb2cf35f) */ | |
.ace_gutter { | |
background: #3A3E45; | |
color: #90908A; | |
} | |
.ace_print-margin { |
This file contains hidden or 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(tidyverse) | |
unique_sums <- expand.grid(dice_1 = 1:6, dice_2 = 1:6) %>% | |
mutate(die_sum = dice_1 + dice_2) %>% | |
pull(die_sum) %>% | |
unique() | |
all_divisble <- function(x, divisor) { | |
divisible_int <- identical((x / divisor), round(x / divisor)) |
This file contains hidden or 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(sfweight) | |
library(tidyverse) | |
acs %>% | |
mutate(nb = st_neighbors(geometry), | |
# centroids are used for distance calculation | |
centroid = st_centroid(geometry), | |
# finding nearest polygon based on centroid | |
nb2 = st_knn(centroid), |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<!-- Generated by: TmTheme-Editor --> | |
<!-- ============================================ --> | |
<!-- app: http://tmtheme-editor.herokuapp.com --> | |
<!-- code: https://github.com/aziz/tmTheme-Editor --> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Alll the things</string> |
This file contains hidden or 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
options("repos" = c("CRAN" = "https://packagemanager.rstudio.com/cran/__linux__/focal/latest")) | |
install.packages("pak") | |
# List of R packages to install | |
to_install <- readLines("all-pkgs.txt") | |
# copy of purrrs safely function for system requirements. | |
# this way we can capture errors associated with packages that | |
# wont be in paks database | |
capture_error <- function (code, otherwise = NULL, quiet = TRUE) { |
This file contains hidden or 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
/* rs-theme-name: xxEmoCandyLandxx*/ | |
/* rs-theme-is-dark: TRUE */ | |
.ace_gutter { | |
background: #372b2b3d; | |
color: #a36666; | |
} | |
.ace_print-margin { | |
width: 2px; | |
background: rgba(218, 146, 37, 0.470588); |
This file contains hidden or 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
dput(sort(unique(as.character(tcltk::tkfont.families())))) | |
#> Warning in fun(libname, pkgname): couldn't connect to display ":0" | |
#> Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj"): [tcl] invalid command name "font". | |
sessionInfo() | |
#> R version 4.1.2 (2021-11-01) | |
#> Platform: aarch64-apple-darwin20 (64-bit) | |
#> Running under: macOS Monterey 12.0 | |
#> | |
#> Matrix products: default | |
#> BLAS: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRblas.0.dylib |
This file contains hidden or 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
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf")) | |
geo <- sf::st_centroid(nc) |> | |
sf::st_geometry() | |
tris <- geo |> | |
geos::geos_make_collection() |> | |
geos::geos_delaunay_triangles() | |
# this is what i would've preferred (and now do) |