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
| #' -------------------------- | |
| #' I recently had to make a map of a small area | |
| #' with an inset showing context. So, here | |
| #' is the code (this is for the Stone Living Lab | |
| #' Living Seawalls), but you should be able to modify | |
| #' it for whatever you want, or even use rnaturalearth | |
| #' and replace the blow-up of the small area with a vector | |
| #' map instead of a raster. Note, you will need | |
| #' an API key from maptiler for the vectors to work. | |
| #' -------------------------- |
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
| #sublinear | |
| library(deSolve) | |
| # adapted from | |
| # https://hankstevens.github.io/Primer-of-Ecology/DDgrowth.html | |
| sublinear <- function(t, y, p){ | |
| bi <- y[1] | |
| dN.dt <- with(as.list(p), | |
| r*b0^(1-k)*bi^k - z*bi |
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
| --- | |
| title: "test" | |
| format: revealjs | |
| --- | |
| # DAG Before You Model | |
| [Which of these is your model?]{.center} | |
| ::: {.columns} |
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(dplyr) | |
| library(piecewiseSEM) | |
| make_tests <- function(){ | |
| dat <- tibble( | |
| x <- runif(100), | |
| x1 = rnorm(100, x, sd = 0.001), | |
| x2 = rnorm(100, x, sd = 0.001), | |
| x3 = runif(100), | |
| y1 = rnorm(100, x1 + x3, sd = 0.1), |
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
| --- | |
| title: "1. How to work with satellite data in R" | |
| output: | |
| html_document: | |
| df_print: paged | |
| --- | |
| This tutorial will show the steps to grab data in ERDDAP from R, how to work with NetCDF files in R and how to make some maps and time-series of sea surface temperature (SST) around the main Hawaiian islands. |
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(shiny) | |
| library(rnoaa) | |
| library(leaflet) | |
| ui <- fluidPage( | |
| leafletOutput("map"), | |
| plotOutput("tempPlot") | |
| ) | |
| server <- function(input, output) { |
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(palmerpenguins) | |
| library(ggplot2) | |
| library(geomtextpath) | |
| ggplot(penguins, | |
| aes(x = body_mass_g, y = flipper_length_mm, | |
| color = species, label = species)) + | |
| geom_point(alpha = 0.2) + | |
| geom_labelsmooth(method = "lm", boxlinewidth = 0) + |
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
| #' ---------------------------------- | |
| #' Get simulated posterior fits from a gllvm | |
| #' based on code from Francis KC Hui | |
| #' with some light modifications by Jarrett Byrnes | |
| #' ---------------------------------- | |
| require(mvtnorm) | |
| require(tidyr) | |
| require(dplyr) |
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
| #gllvm reprex on posthocs | |
| library(palmerpenguins) | |
| penguins <- na.omit(penguins) | |
| Y <- with(penguins, data.frame(bill_length_mm, bill_depth_mm, | |
| flipper_length_mm, body_mass_g)) | |
| X <- with(penguins, data.frame(species, sex)) |
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
| #'-------------------------------------------------- | |
| #' Script for gmail analysis between two people | |
| #' using gmailr | |
| #'-------------------------------------------------- | |
| library(gmailr) | |
| library(tidyverse) | |
| library(rties) | |
| library(lubridate) | |
| library(gganimate) |
NewerOlder