knitr::opts_chunk$set(echo = TRUE)
next steps (think about all of project along the way) and read about the study to conceptualize water quality http://longislandsoundstudy.net/research-monitoring/water-quality-monitoring/
#cheetsheet # https://github.com/rstudio/cheatsheets/blob/master/data-transformation.pdf install.packages("devtools") devtools::install_github("tidyverse/dplyr") library("devtools") install.packages("utils") library("utils") install.packages("tidyverse") library("tidyverse") install.packages("dplyr") library("dplyr") install.packages("readr") library("readr") library(dplyr) library(tidyr) library(mapview)
dat <- readr::read_csv("~/Desktop/dummy_dataset.csv")
mastersheet <- readr::read_csv("C:/Users/Sophia/Desktop/ADP/RStudio/sa346/Group Project/LongIsland_Project/Data/CoordinatesTimeDiff.csv") #the project is my working directoy, and the csv file is in there, so not sure why r is saying it doens't exist
read_csv %>% distinct(uuid, .keep_all = TRUE) %>% select(uuid, x, y) %>% mutate(count = 1) %>% st_as_sf(coords = c("x", "y"))
dir(pattern = "farmer_spatial.csv|[districts|roads]*.*.shp", full.names = TRUE) %>% map(function(x) { if(basename(x) == "farmer_spatial.csv") { read_csv(x) %>% st_as_sf(., coords = c("x", "y"), crs = 4326) } else { st_read(x) } }) %>% set_names(c("d", "f", "r")) -> sdat
farmers <- system.file("extdata/farmer_spatial.csv", package = "geospaar") %>% read_csv() %>% st_as_sf(coords = c("x", "y"), crs = 4326)
library(geospaar) system.file("extdata/", package = "geospaar") %>% dir(pattern = "farmer_spatial.csv|[districts|roads]*.*.shp", full.names = TRUE) %>% map(function(x) { if(basename(x) == "farmer_spatial.csv") { read_csv(x) %>% st_as_sf(., coords = c("x", "y"), crs = 4326) } else { st_read(x) } }) %>% set_names(c("d", "f", "r")) -> sdat
st_transform(sdat$d, crs = st_crs(sdat$r)) %>% st_intersection(x = ., y = rd_sel_buff) %>% st_geometry %>% plot(col = bpy.colors(length(.)))
head() <- as_tibble() <- data.table() aggregate(d$b, list(d$a), mean) d_tb %>% group_by(a) %>% summarize(mean(b)) d_dt[, mean(b), by = a][order(a)] #Think about Indexing a <- 1:10 b <- a names(b) <- letters[1:10]
mapview(mastersheet) addHomeButton(mastersheet) addMouseCoordinates() install.packages('ggsn')
time <- 1:nlayers(chirpsz) fun <- function(x) { if(any(is.na(x))) { o <- NA } else { o <- lm(x ~ time)$coefficients[2] } o } chirpsz_reg <- calc(chirpsz, fun = fun) chirpsz_reg %>% plot
```r
methodology notes
Look at class slides
intermediate stats class for pattern/cluster anlaysis - maybe play around with this in SPSS
regression - stats
covariance, Correlation- the degree to which two variables “covary”. Correlation accounts for the standard deviations of the measures and varies from (-1, +1) Correlation coefficient R expresses the degree of fit. Coefficient of Determination (r2) expresses the percentage of variance in Y that is explained by x
Regression- mathematical specification of relationship between two variables, where one is the dependent (Y) variable and one is the independent variable (X)
Time series analysis
Index Time series Image times series Time Series File
Median trend (Theil-Sen)-slope of every pairwise combination then finds median value. breakdown bond of 29 percent: trends expressed in the image must have persisted for more than 29 percent of their length of the series.
Monotonic trend (Mann-Kendall)- measures how consistently is the trend increasing or decreasing. Has range from -1 to 1, (constantly increases and never decreases and vice versa). A value of 0 indicates no consistent trend.
All pairwise combinations of values over time are evaluated and a tally is made of the number that are increasing or are decreasing over time. Mann-Kendall Significance- produces 2 images, measuring significance of Mann-Kendall Trend one is a significance image expressed as Z scores one is an image that expresses the probability that the observed trend could have occurred by chance.
(there are more notes in google from advaned Raster (Test 1 prep work etc))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.