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
# create_regions.py: generate non-overlapping regions extending administrative areas into the ocean | |
# within the exclusive economic zone by a given buffer. For the latest version, | |
# see: https://gist.github.com/bbest/7650602. | |
# | |
# This generates the following shapefiles in the output directory: | |
# rgns_[offshore|inland]{distance}{units}_[gcs|mol] | |
# where: | |
# rgns = regions | |
# offshore = zone extending from shore to the EEZ | |
# inland = zone extending from shore inland |
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
# remove old packages | |
for (p in c('ohicore','ohigui','rCharts')){ | |
if (p %in% rownames(installed.packages())){ | |
lib = subset(as.data.frame(installed.packages()), Package==p, LibPath, drop=T) | |
remove.packages(p, lib) | |
} | |
} | |
# install dependencies | |
for (p in c('devtools')){ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# remove old packages | |
for (p in c('ohicore','ohigui','rCharts')){ | |
if (p %in% rownames(installed.packages())){ | |
lib = subset(as.data.frame(installed.packages()), Package==p, LibPath, drop=T) | |
remove.packages(p, lib) | |
} | |
} | |
# install dependencies | |
for (p in c('devtools')){ |
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
license: mit | |
height: 300 | |
scrolling: no | |
border: no |
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: "Maxent Species Report" | |
output: html_document | |
--- | |
Here's a quick way to loop through running a bunch of species and generating a document by running Knit HTML in RStudio. | |
```{r, results='asis'} | |
spp = c('a','b','c') | |
for (sp in spp){ |
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
## Tibble -> Nest -> Model -> Plot -> TrelliscopeJS | |
Source: [schloerke/stat695data](https://github.com/schloerke/stat695data#gapminder) | |
```{r} | |
library(gapminder) | |
tibble::glimpse(gapminder) | |
# look per continent |
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
# try whisker plots on uncertainty estimates | |
library(tidyverse) | |
d = tribble( | |
~sp, ~source, ~n, ~cv, | |
'hw', '1999 Smith', 10400, 0.138, | |
'hw', '2003 Stevick', 11570, 0.068, | |
'hw', '2012 Palka', 335, 0.42, | |
'hw', '2016 Roberts', 1633, 0.07, |