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(RCurl) | |
# Fetching burn rasters --------------------------------------------------- | |
# get and read the file listing from the usgs server | |
prefix <- 'https://rmgsc.cr.usgs.gov/outgoing/baecv/BAECV_CONUS_v1_2017/' | |
download.file(prefix, destfile = 'listing.txt') | |
out <- readLines('listing.txt') | |
# now create paths to each tar.gz file by processing the html |
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(rgdal) | |
library(rgeos) | |
library(raster) | |
library(gdalUtils) | |
# gdalinfo("GFED40_MQ_199506_BA.hdf") | |
# sds <- get_subdatasets("GFED40_MQ_199506_BA.hdf") | |
# sds |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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(parallel) | |
# Create matrix to store result ------------------------------------------- | |
M <- 4 | |
N <- 6 | |
A <- matrix(0, nrow = M, ncol = N) | |
list <- list(3, 4, 6) | |
# Serial version ---------------------------------------------------------- |
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
# Script to evaluate small sample behavior of Weibull parameter MLEs -------- | |
library(fitdistrplus) | |
library(dplyr) | |
library(tidyr) | |
library(gridExtra) | |
library(parallel) | |
library(ggplot2) | |
library(viridis) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Simulation script for factor analysis ala Leung & Drton (2016) ---------- | |
library(rstan) | |
library(bayesplot) | |
m <- 5 # dimension of observed data (e.g., # traits) | |
k <- 2 # number of latent factors | |
n <- 100 # number of sample units (e.g., # species) | |
# residual variance matrix (is diagonal) | |
Omega <- diag(.3 + abs(rnorm(m, sd = .3))) |
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
data { | |
int<lower=1> n; | |
vector[n] x; | |
vector[n] y; | |
} | |
parameters { | |
real alpha; | |
vector[2] beta; | |
real<lower=0> sigma; |
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
# Importing data from USDA into large data file --------------------------- | |
library(stringr) | |
library(dplyr) | |
path_to_data <- "~/Desktop/ams_cattle_data/" | |
data_files <- list.files(path = path_to_data, pattern = "cattle", | |
full.names = TRUE) | |
# Define helper functions ------------------------------------------------- |