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
#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 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 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 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(emmeans) | |
library(brms) | |
library(tidybayes) | |
warp.brms <- brm(breaks ~ wool * tension, data = warpbreaks) | |
#get the adjusted means | |
warp_em <- emmeans (warp.brms, ~ tension | wool) | |
warp_em |
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
--- | |
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 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 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
#Load the library and make a basic map | |
library(leaflet) | |
leaflet() %>% addTiles() | |
#Show a map with a satellite picture on it | |
leaflet() %>% | |
addTiles(urlTemplate="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}") | |
#Make a demo fake data set |
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(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 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 to generate simulations comparing the power and type I error rate | |
#of a variety of different methods of analyzing response variables on a unit (0-1) scale | |
# | |
# Inspired by "The Arcsine is Asinine" in a 2011 issue of Ecology | |
# | |
# byrnes@nceas.ucsb.edu | |
# last updated 5/19/11 | |
# | |
# Changelog: Added visualization code |
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) |
NewerOlder