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(zyp) | |
library(mblm) | |
# From https://library.virginia.edu/data/articles/theil-sen-regression-programming-and-understanding-an-outlier-resistant-alternative-to-least-squares | |
theil_sen <- function(x,y){ | |
n <- length(x) | |
max_n_slopes <- (n * (n - 1)) / 2 | |
slopes <- vector(mode = 'list', length = max_n_slopes) # list of NULL elements | |
add_at <- 1 | |
# Calculate point-to-point slopes if x_i != x_j |
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(ggplot2) | |
library(dplyr) | |
theme_set(theme_minimal(base_size = 16)+ | |
theme_bw()+ | |
theme(panel.border = element_rect("black",fill=NA,linewidth=1))) | |
# Create sample data | |
set.seed(123) | |
n <- 100 | |
groups <- 5 |
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
# Libraries | |
# devtools::install_github("SwampThingPaul/AnalystHelper") | |
library(AnalystHelper); | |
library(plyr) | |
library(reshape2) | |
# ------------------------------------------------------------------------- | |
# DATA_CSV = data location on PC | |
caze.ice = read.csv(DATA_CSV,sep="\t",na.strings = "-999") |
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
## Example Recurrence (or return) interval analysis | |
## functions to calculate return interval for | |
## empirical, Gumbel and Log Pearson distributions | |
library(lmom) | |
recur.fun=function(x){ | |
#Sorting data by decreasing order | |
sorted.values<-sort(x,decreasing=T) | |
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
## Example spatial interpolation | |
# GIS libraries | |
library(rgdal) | |
library(rgeos) | |
library(raster) | |
# kriging | |
library(gstat) |
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
## Objective: To query FDEP's ArcGIS REST server via R | |
## You must have server link and know a little about the dataset. | |
## | |
## Due to the query limit and area of interest, query is broken into two regions | |
### Libraries | |
library(httr) | |
library(jsonlite) | |
path <- 'https://services1.arcgis.com/nRHtyn3uE1kyzoYc/arcgis/rest/services/VIEW_FL_Algal_Bloom_Site_Visits_1/FeatureServer/0/query?' |
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(sp) | |
library(rgeos) | |
library(rworldmap) | |
# epsg.io | |
wgs=CRS("+init=epsg:4326") | |
map_dat=getMap() | |
map_dat=spTransform(map_dat,wgs) |
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
# This is a very general script to perform gif animations from | |
# space-time Generalized Additive Model predictions | |
# GIS libraries | |
library(rgdal) | |
library(rgeos) | |
library(raster) | |
library(tmap) | |
# GAM libraries |
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
# GIS libraries | |
library(sp) | |
library(rgdal) | |
library(rgeos) | |
library(raster) | |
library(mapmisc) | |
## defines the coordinate reference system | |
utm17=CRS("+init=epsg:26917") |
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
using DelimitedFiles | |
using DataFrames | |
# HTML Path for data | |
dat_path="http://recondata.sccf.org/cgi-data/nph-data.cgi?x=utc_date&y=salinity,temperature&min_date=20210101&max_date=20220301&node=11&data_format=text" | |
# Just to read the data as a tab delimited file | |
recon_data=readdlm(download(dat_path),'\t',skipstart=1,header=true) | |
## From what I can find on how to change the file |
NewerOlder