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(tidyverse) | |
library(ggmap) | |
library(sf) | |
library(tmap) | |
#whereami? | |
here::here() | |
#get my apis flowin' | |
register_google(readLines("~/goog.api")) |
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(tidyverse) | |
library(tidytext) | |
library(rvest) | |
library(ggplot) | |
#get the initial info from the site | |
site <- "http://www.guscantieni.com/bindarrr/" | |
index <- read_html(paste0(site, "index.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
#Rayshader reprex to try and put a flat raster map under a | |
#set of 3d points | |
library(rayshader) | |
library(ggplot2) | |
library(dplyr) | |
library(maps) | |
library(ggmap) | |
data(world.cities) |
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
#see also https://davidsmale.netlify.com/portfolio/wes-anderson-actor-network/ | |
# https://www.data-imaginist.com/2017/introducing-tidygraph/ | |
# https://www.jessesadler.com/post/network-analysis-with-r/ | |
#load libraries | |
library(rglobi) | |
library(tidygraph) | |
library(ggraph) | |
library(NetIndices) |
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(spdep) | |
library(spatialreg) | |
library(SpatialTools) | |
library(dplyr) | |
library(nlme) | |
library(mgcv) | |
library(purrr) | |
library(stringr) | |
library(ggplot2) | |
library(broom) |
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(MASS) | |
library(tidyverse) | |
library(ggplot2) | |
library(mgcv) | |
gaussprocess <- function(from = 0, to = 1, K = function(s, t) {min(s, t)}, | |
start = NULL, m = 1000) { | |
# Simulates a Gaussian process with a given kernel | |
# | |
# args: |
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(heatwaveR) | |
library(tsibble) | |
library(lubridate) | |
library(dplyr) | |
# Detect the events in a time series | |
ts <- ts2clm(sst_WA, climatologyPeriod = c("1982-01-01", "2011-12-31")) | |
mhw <- detect_event(ts, minDuration = 1, maxGap = 0) |
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(ggplot2) | |
library(gganimate) | |
mygridstart <- tidyr::crossing(x = 1:10, y = 1:10) | |
mygrid <- rbind(mygridstart, mygridstart, mygridstart) | |
mygrid$rep <- sort(rep(1:3, nrow(mygrid)/3)) | |
mygrid$pointgroup <- rep(1:100, 3) | |
mygrid$f <- factor(sample(1:3, replace=TRUE, size = nrow(mygrid))) |
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(dplyr) | |
library(tidyr) | |
library(stringr) | |
library(ggplot2) | |
library(gganimate) | |
#make those samples! | |
set.seed(3003) | |
samps <- replicate(9, rbinom(1,1,prob = 0.3)) | |
running_samps <- cumsum(samps) |
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
#some libraries | |
library(dplyr) | |
library(tidyr) | |
library(broom) | |
library(purrr) | |
#let's use the npk data | |
head(npk) | |
#but make up a few extra columns |