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(shiny) | |
# example data | |
df <- | |
as.data.frame(matrix(rnorm(250), nrow=25)) %>% | |
rownames_to_column(var = "Year") %>% | |
mutate(Year = as.numeric(Year)) | |
# Define UI for application that draws a histogram |
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
function (data, maxiter = 10L, pmm.k = 0L, seed = NULL, verbose = 1, returnOOB = F, ...){ | |
if (verbose > 0) { | |
cat("\nMissing value imputation by chained tree ensembles\n") | |
} | |
stopifnot(is.data.frame(data), dim(data) >= 1L, is.numeric(maxiter), | |
length(maxiter) == 1L, maxiter >= 1L, is.numeric(pmm.k), | |
length(pmm.k) == 1L, pmm.k >= 0L, !(c("formula", "data", | |
"write.forest", "probability", "split.select.weights", | |
"dependent.variable.name", "classification") %in% | |
names(list(...)))) |
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
# Turbo colour ramp from: | |
# https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html?m=1 | |
turbo_palette <- | |
colorRampPalette( | |
rgb( | |
matrix( | |
c(0.18995, 0.07176, 0.23217, 0.19483, 0.08339, 0.26149, 0.19956, 0.09498, 0.29024, 0.20415, 0.10652, 0.31844, 0.20860, 0.11802, 0.34607, 0.21291, 0.12947, 0.37314, | |
0.21708, 0.14087, 0.39964, 0.22111, 0.15223, 0.42558, 0.22500, 0.16354, 0.45096, 0.22875, 0.17481, 0.47578, 0.23236, 0.18603, 0.50004, 0.23582, 0.19720, 0.52373, | |
0.23915, 0.20833, 0.54686, 0.24234, 0.21941, 0.56942, 0.24539, 0.23044, 0.59142, 0.24830, 0.24143, 0.61286, 0.25107, 0.25237, 0.63374, 0.25369, 0.26327, 0.65406, |
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
# devtools::install_github("tylermorganwall/rayshader") | |
library(rayshader) | |
library(raster) | |
# replace these with your rasters | |
r_shadow <- raster("to_shadow.tif") | |
r_elev <- raster("to_elev.tif") | |
# resample elevation raster to extent/res of shadow raster | |
r_elev <- resample(r_elev, r_shadow, method='bilinear') |
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(hues) | |
library(priceR) | |
library(readxl) | |
# get the file | |
download.file( | |
url = "https://www.abs.gov.au/statistics/industry/mining/mineral-and-petroleum-exploration-australia/dec-2020/8412005.xls", | |
destfile = "8412005.xls" | |
) |