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
| setwd("D:/TWSA_198101-202006/Tiff_198101_202006") | |
| file_list <- list.files( | |
| full.names = FALSE | |
| ) | |
| # reorder by gtools | |
| library(gtools) | |
| file_list <- mixedsort(file_list) |
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
| % Get geo referenced | |
| % No longer supported: | |
| % R = georasterref('RasterSize',[180 360],'LatitudeLimits',[-89.5,89.5],'LongitudeLimits',[0.5,359.5]); | |
| latlim = [-90,90]; | |
| lonlim = [0,360]; | |
| rasterSize = [180 360]; | |
| R = georefcells(latlim,lonlim,rasterSize,'ColumnsStartFrom','north'); |
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(Kendall) | |
| # Annual precipitation entire Great Lakes | |
| # The time series plot with lowess smooth suggests an upward trend | |
| # The autocorrelation in this data does not appear significant. | |
| # The Mann-Kendall trend test confirms the upward trend. | |
| data(PrecipGL) | |
| plot(PrecipGL) | |
| lines(lowess(time(PrecipGL),PrecipGL),lwd=3, col=2) | |
| acf(PrecipGL) | |
| MannKendall(PrecipGL) |
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
| setwd("I:/OneDrive - University of Texas at Arlington/Summer Papers/Texas_Water_Study/WRM_journal/CMIP5_downloader/evspsbl_Amon_GFDL-CM3_rcp85_r1i1p1_200601-202012") | |
| file_list <- list.files( | |
| full.names = FALSE | |
| ) | |
| # reorder by gtools | |
| library(gtools) | |
| file_list <- mixedsort(file_list) |
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
| addr = "I:/OneDrive - University of Texas at Arlington/Summer Papers/Texas_Water_Study/WRM_journal/CMIP5_downloader/evspsbl_Amon_GFDL-CM3_rcp85_r1i1p1_200601-201012" | |
| period <- seq(as.Date("2006/01/01"), by = "month", length.out = 60) | |
| name <- paste0("evspsbl_Amon_GFDL-CM3_rcp85_r1i1p1_", period) | |
| old_files <- list.files(addr,pattern = "*.tif", full.names = TRUE) | |
| # reorder by gtools | |
| library(gtools) | |
| old_files <- mixedsort(old_files) |
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
| setwd("I:/OneDrive - University of Texas at Arlington/Summer Papers/Texas_Water_Study/WRM_journal/CMIP5_downloader/evspsbl_Amon_GISS-E2-R_rcp45_r1i1p1_200601-202512") | |
| file_list <- list.files( | |
| full.names = FALSE | |
| ) | |
| # reorder by gtools | |
| library(gtools) | |
| file_list <- mixedsort(file_list) |
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) | |
| library(ggExtra) | |
| # Define the palette | |
| reverseRainbow <- tail(rev(rainbow(10)), 8) | |
| data<-read.csv(file.choose(), header=TRUE) | |
| data$height <- -data$bathymetry | |
| ## Chl | |
| p1= ggplot(data, aes(x=vgpm, | |
| y=eppley, |
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
| function []=scatter_plot_sta(x,y) | |
| Array=csvread('dryland_BSk.csv',1,0); | |
| x = Array(:, 2); | |
| y = Array(:, 1); | |
| % n = 2000; | |
| % R = [0.1 4]; | |
| % x = rand(n,1)*range(R)+min(R) |
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
| # Read Data: | |
| d = read.csv(file.choose(), header = TRUE) | |
| # Date suc has 4/1/2002, use "%m/%d/%y" | |
| d$Date<- as.Date(d$Date, "%m/%d/%y") | |
| # Group by Month | |
| Month <- format(d$Date, "%m") | |
| # Calculating the monthly anoamlies | |
| anom <- d$Values - ave(d$Values, Month, FUN = function(x) mean(x, na.rm = TRUE)) | |
| d$anom <- anom |
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) | |
| library(rgdal) | |
| library(dplyr) | |
| r1 <- raster("pop_GERMANY.tif") | |
| r1 <-r1[(r1 > 1)] | |
| # boxplot(r1, log="y", outline=TRUE, ylim = c(1, 30000), main='Germany', ylab='Population Density (km^2)' ) | |
| library(ggplot2) | |
| library(ggExtra) |
NewerOlder