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
| ########### | |
| # Libraries | |
| ########### | |
| library(sp) | |
| library(rgdal) | |
| library(rgeos) | |
| library(raster) | |
| library(tidyverse) | |
| library(spdplyr) |
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
| Traceback (most recent call last): | |
| File "/usr/local/bin/gdal_polygonize.py", line 36, in <module> | |
| import gdal, ogr, osr | |
| File "/Library/Frameworks/GDAL.framework/Versions/1.11/Python/2.7/site-packages/gdal.py", line 2, in <module> | |
| from osgeo.gdal import deprecation_warn | |
| File "/Library/Frameworks/GDAL.framework/Versions/1.11/Python/2.7/site-packages/osgeo/__init__.py", line 21, in <module> | |
| _gdal = swig_import_helper() | |
| File "/Library/Frameworks/GDAL.framework/Versions/1.11/Python/2.7/site-packages/osgeo/__init__.py", line 17, in swig_import_helper | |
| _mod = imp.load_module('_gdal', fp, pathname, description) | |
| ImportError: dlopen(/Library/Frameworks/GDAL.framework/Versions/1.11/Python/2.7/site-packages/osgeo/_gdal.so, 2): Symbol not found: _GTIFAllocDefn |
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) | |
| library(ggplot2) | |
| library(visreg) | |
| #some fake data | |
| set.seed(35) | |
| my_data <- data.frame(x1 = runif(100,-50,50), x2 = runif(100, -50, 50)) %>% | |
| mutate(y = rnorm(100, 0.001*x2*(x1 - x1^2), 100)) | |
| #let's see that data |
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) | |
| library(gapminder) | |
| library(broom) | |
| library(ggplot2) | |
| life_exp_mods <- gapminder %>% | |
| #do this for each country | |
| group_by(country) %>% | |
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
| #'---------------- | |
| #' Discrete time logistic growth model | |
| #' Using purrr and iwalk | |
| #'---------------- | |
| library(purrr) | |
| r <- 3.95237783423 | |
| n0 <- 0.3 |
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(rnaturalearth) | |
| library(rnaturalearthdata) | |
| library(ggplot2) | |
| oceans <- ne_download(type = "ocean", category = "physical", returnclass="sf") | |
| ocean_antarctic <- st_transform(oceans, 2154) | |
| ggplot(ocean_antarctic) + | |
| geom_sf(fill = "lightblue", color=NA) |
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(ggplot2) | |
| #A glm from the glm helpfile | |
| counts <- c(18,17,15,20,10,20,25,13,12) | |
| outcome <- gl(3,1,9) | |
| treatment <- gl(3,3) | |
| print(d.AD <- data.frame(treatment, outcome, counts)) | |
| glm.D93 <- glm(counts ~ outcome + treatment, family = poisson()) | |
| #The old way... |
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(raster) | |
| #devtools::install_github("jebyrnes/hadsstr") | |
| library(hadsstr) #from jebyrnes/hadsstr | |
| library(ggplot2) | |
| library(sf) | |
| library(rnaturalearth) | |
| #get the world in the lambert projection | |
| countries_50_sf <- ne_download(scale = 50, category = 'cultural', type = 'countries', returnclass="sf") | |
| countries_lambert <- st_transform(oceans, 2154) |
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) | |
| 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 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
| brainGene <- structure(list(group = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, | |
| 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, | |
| 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, | |
| 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("control", "schizo", "bipolar" | |
| ), class = "factor"), PLP1.expression = c(-0.02, -0.27, -0.11, | |
| 0.09, 0.25, -0.02, 0.48, -0.24, 0.06, 0.07, -0.3, -0.18, 0.04, | |
| -0.16, 0.25, -0.1, -0.31, -0.05, 0.11, -0.38, 0.23, -0.23, -0.28, | |
| -0.36, -0.22, -0.4, -0.19, -0.34, -0.29, -0.12, -0.34, -0.39, | |