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(patchwork) | |
toplo1 <- sqidat %>% | |
select(MasterID, yr, asci_mean, csci_mean, TN, TP, indexscore_cram) %>% | |
gather('nuts', 'val', TN, TP) %>% | |
na.omit %>% | |
mutate( | |
inddif = asci_mean - csci_mean, | |
cramcat = case_when( |
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(gridExtra) | |
library(grid) | |
library(imputeTestbench) | |
library(PSF) | |
library(imputePSF) | |
library(imputeTS) | |
library(scales) | |
# total obs in each simulated time series |
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
# load libraries | |
library(sf) | |
library(maps) | |
library(tmap) | |
# get states as sf | |
states <- st_as_sf(map('state', plot = F, fill = T)) | |
# calculate area, add to states | |
area <- st_area(states) |
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
# load packages | |
library(sf) | |
library(plotly) | |
library(mapview) | |
# download data and save in memory | |
wsa <- read.csv("https://www.epa.gov/sites/production/files/2014-10/wsa_siteinfo_ts_final.csv") | |
# make an sf object | |
wsa <- st_as_sf(wsa, coords = c("LON_DD", "LAT_DD"), crs = 4269,agr = "constant") |
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
# load libraries | |
library(sf) | |
library(maps) | |
library(ggplot2) | |
# get states as sf | |
states <- st_as_sf(map('state', plot = F, fill = T)) | |
# calculate area, add to states | |
area <- st_area(states) |
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
# load libraries | |
library(sp) # for meuse | |
library(sf) # for sf objects | |
library(ggmap) # for base maps | |
library(ggplot2) # for mapping | |
# import dataset, check structure | |
data(meuse) | |
str(meuse) |
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: "Basic mapping" | |
author: "Turbo Todd" | |
output: html_document | |
--- | |
This lessons covers base graphics, ggplot, and other R packags for mapping spatial data. | |
```{r} | |
library(maps) |
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
echo sha, contributor, date, message > log.csv | |
git log --date=local --pretty=format:'%h, %an, %ad, "%s"' >> log.csv |
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
#' Format a text file for mothur | |
#' | |
#' @param fl chr string for input file | |
#' @param rev_cmp logical if file needs reverse complemeNT | |
#' @param savefl logical if output file is saved, otherwise the output is returned in the console | |
moth_form <- function(fl, rev_cmp = FALSE, savefl = TRUE, flnm = 'myfile.txt'){ | |
# import file | |
dat <- read.table(fl, sep = '\t') | |
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
plotFlowConc <- function(eList, month = c(1:12), years = NULL, col_vec = c('red', 'green', 'blue'), ylabel = NULL, xlabel = NULL, alpha = 1, size = 1, allflo = FALSE, ncol = NULL, grids = TRUE, scales = NULL, interp = 4, pretty = TRUE, use_bw = TRUE, fac_nms = NULL, ymin = 0){ | |
localDaily <- getDaily(eList) | |
localINFO <- getInfo(eList) | |
localsurfaces <- getSurfaces(eList) | |
# plot title | |
toplab <- with(eList$INFO, paste(shortName, paramShortName, sep = ', ')) | |
# flow, date info for interpolation surface |
NewerOlder