/**
* @license
* Copyright 2020 Google LLC.
* SPDX-License-Identifier: Apache-2.0
*
* Generates wind trajectory maps and animations from ECMWF ERA-5 hourly wind
* data. A set of random points are drawn within an area of interest; a path is
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(tidyverse) | |
library(sf) | |
library(terra) | |
library(stars) | |
library(ggspatial) | |
library(systemfonts) | |
library(patchwork) | |
register_variant( | |
name = "Input Mono Light", |
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
# packages | |
pacman::p_load('ps', "rgee", "tidyverse", "sf", "ggplot2", "patchwork", | |
'reticulate', 'googledrive', 'stars', 'plotKML', 'readxl', | |
'networkD3', 'OpenLand', 'ggtern') | |
ee_Initialize(email = '[email protected]') | |
# CORINE | |
clc18 = ee$Image('COPERNICUS/CORINE/V20/100m/2018')$select('landcover'); | |
clc12 = ee$Image('COPERNICUS/CORINE/V20/100m/2012')$select('landcover'); |
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
# packages | |
pacman::p_load('ps', "rgee", "tidyverse", "sf", "ggplot2", "patchwork", | |
'reticulate') | |
ee_Initialize(email = '[email protected]') | |
# Hansen Global Forest Change | |
forestloss <- ee$Image("UMD/hansen/global_forest_change_2019_v1_7") | |
flossyear <- forestloss$select('lossyear') |
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
# Packages ---- | |
library(bioRad) | |
library(rhdf5) | |
library(tidyverse) | |
library(lubridate) | |
library(zoo) | |
library(RColorBrewer) | |
library(patchwork) |
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(tidyverse) | |
library(lubridate) | |
library(forcats) | |
library(janitor) | |
library(ggplot2) | |
library(ggthemr) | |
ggthemr('grape') | |
# Read Tables ---- | |
refs <- read_csv('path to reference wdpa csv file') %>% |
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
# Paulo E. Cardoso 2020-05-15 | |
# Read EXIF Metadata from Photos obtained with SmarthPhone | |
# Initial instructions ---------------------------------- | |
# Download ExifTool executable from https://exiftool.org/ and | |
# unzip the exiftool(-k).exe to Rstudio Project root folder | |
# Download your fotos to (this case) data-raw folder | |
# Assuming .jpg image files | |
# Install packages ---------------------------------------- |
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
# Unsupervided Classification of Landsat images | |
# !UTIL http://bioinf.wehi.edu.au/marray/ibc2004/lab4/lab4.html | |
# !UTIL http://www.digital-geography.com/unsupervised-classification-of-a-landsat-image-in-r-the-whole-story-or-part-two/ | |
# !UTIL http://www.jstatsoft.org/v15/i09/paper | |
# !UTIL http://cran.r-project.org/web/packages/e1071/e1071.pdf | |
# Packages | |
kpacks <- c('raster', 'sp', 'rgdal', 'cluster') | |
new.packs <- kpacks[!(kpacks %in% installed.packages()[,"Package"])] | |
if(length(new.packs)) install.packages(new.packs) |
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
#! Gráfico de Barras GGPLOT | |
#! Paulo Eduardo Cardoso | |
library(chron) | |
library(ggplot2) | |
horas <- read.table("clipboard",header=T) | |
horas <- strptime(as.character(horas[,1]),"%H:%M:%S") | |
horaH <- data.frame("Hora"=hours(horas)) | |
horasdia <- data.frame("Hora"=c(0:23)) | |
postsH <- as.data.frame(table(horaH)) | |
postsDia <- merge(horasdia,postsH,by.x="Hora",by.y="horaH",all.x=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
#! Compositional Analysis | |
#! Paulo Eduardo Cardoso | |
library(adehabitat) | |
#! Análise Compana para matrizes lidas a partir do clipboard. | |
usado <- read.delim("clipboard", sep = "\t", dec = ".", header = T) | |
#! Remove linhas sem dados - NA | |
usado <- usado[!is.na(usado[1]),] | |
#! Constroi a matriz de disponiveis alterando os valores em dispo | |
dispo <- as.data.frame(cbind(rep(27.3,nrow(usado)),rep(19.8,nrow(usado)),rep(80.2,nrow(usado)))) |
NewerOlder