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
stickplot.arrows=function(DateTime,WSPD,WD,data,...){ | |
require(lubridate) | |
#DateTime = Date and Time in POSIXct format (also works with just dates) | |
#WSPD = Wind Speed in velocity units (i.e. m/s) | |
#WD = Wind direction in degrees | |
if(!missing(data)){ | |
DateTime=data[,deparse(substitute(DateTime))] | |
WSPD=data[,deparse(substitute(WSPD))] | |
WD=data[,deparse(substitute(WD))] |
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
#Some Example data | |
library(dataRetrieval) | |
sdate="1979-10-01" | |
edate="2010-12-31" | |
site="02298830" | |
param="00060" | |
dat=readNWISdv(site,param,sdate,edate) | |
#Data manipulation |
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
# Developed based on the ideas Regier et al (2019) Analyzing and comparing | |
## complex environmental time series using a cumulative sums approach. | |
## MethodsX 6:779–787. doi: 10.1016/j.mex.2019.03.014 | |
# | |
# Link to paper: | |
## https://www.sciencedirect.com/science/article/pii/S2215016119300597?via%3Dihub | |
test=c(seq(1,10),rev(seq(1,10))) | |
cusum=round(cumsum(base::scale(test)),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
## | |
## Hydrologic data visualization | |
## | |
## Code was compiled by Paul Julian | |
## contact infor: pjulian@ufl.edu | |
#Clears Everything...start fresh. | |
rm(list=ls(all=T));cat("\014");dev.off() | |
#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
## | |
## Evaluating the potential dilution of variance in long term data | |
## DOI 10.17605/OSF.IO/RPBTS | |
## https://osf.io/rpbts | |
## | |
## Code was compiled by Paul Julian | |
## contact infor: pjulian@ufl.edu | |
library(cumstats) |
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 of color ramp gradient legend in base R | |
## | |
## | |
## Code was compiled by Paul Julian | |
## contact info: pjulian@ufl.edu | |
## | |
## code adpated from several sources including | |
# https://stackoverflow.com/questions/25001542/coloring-the-points-in-a-plot-based-on-another-numeric-variable |
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(rgdal) | |
utm15=CRS("+proj=utm +zone=15 +datum=WGS84 +units=m") | |
wgs84=CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0") | |
# convert to shapefile | |
sp.tribnames=SpatialPointsDataFrame(coords=tribnames[,c("EASTING","NORTHING")],data=tribnames,proj4string = utm15) | |
plot(sp.tribnames) | |
sp.tribnames=spTransform(sp.tribnames,wgs84) |
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
## UTS/South Dade Rainfall discharge | |
## | |
## Code was compiled by Paul Julian | |
## contact info: pjulian@ufl.edu | |
#Libraries | |
library(AnalystHelper);#devtools::install_github("SwampThingPaul/AnalystHelper") | |
library(plyr) | |
library(reshape) |
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
# R version of https://towardsdatascience.com/p-value-explained-simply-for-data-scientists-4c0cd7044f14 | |
# Towards Data Science Article written by Rahul Agarwal (https://towardsdatascience.com/@rahul_agarwal) | |
# WeightLoss Sample Mean (kg) | |
mu=2 | |
# Sample Standard Deviation (kg) | |
sigma=1 | |
## Probability |
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
# R version of https://medium.com/cindicator/must-have-statistical-tests-for-any-data-scientist-weekend-of-a-data-scientist-4543f2c393cd | |
# Medium Article written by Alexander Osipenko (https://medium.com/@subpath) | |
# Fake Data (not the same data as article) | |
set.seed(123) | |
groupA=rnorm(1000) | |
groupB=rnorm(1100,mean=0.001) | |
# Quick Density plot |