I hereby claim:
- I am ozjimbob on github.
- I am jimbob (https://keybase.io/jimbob) on keybase.
- I have a public key whose fingerprint is 7ABC 13B3 C2B3 2583 C3A2 C03C EC2D AA9F 5376 6533
To claim this, I am signing this object:
### Plot length summary | |
data=read.csv("plotBAincr.csv",stringsAsFactors=F) | |
data$Date.start=as.Date(data$Date.start) | |
data$Date.end=as.Date(data$Date.end) | |
plotlist=unique(data$Plot) | |
out_frame=data.frame(Plot="",Date.start="",Date.end="",length=0,stringsAsFactors=F) |
# Run model simulation with given values for: | |
# initial cull, maintenance cull, cell target density, allocated budget, | |
# area to cull, and "control area" (area for which proportional population is calculated) | |
# (last two are kept separate for the spatial optimisation, where we may choose to cull a subset | |
# of the target control area for efficiency) | |
run.sim = function(curr.init.cull, curr.maint.cull, curr.target.density, budget, C.mask, ctrl.mask) | |
{ | |
Nx = ncol(K); Ny = nrow(K); # gauge size of map | |
IC = K # note - initial population is set to carrying capacity |
I hereby claim:
To claim this, I am signing this object:
library(rjson) | |
library(httr) | |
turl="https://iowadems-caucussitecdn-prod2.azureedge.net/api/statecandidateresults" | |
a=GET(turl) | |
arr=c(content(a)$StateResults[[1]]$WinPercentage,content(a)$StateResults[[2]]$WinPercentage,content(a)$StateResults[[3]]$WinPercentage) | |
nam=c(content(a)$StateResults[[1]]$Candidate$DisplayName,content(a)$StateResults[[2]]$Candidate$DisplayName,content(a)$StateResults[[3]]$Candidate$DisplayName) | |
colr=c(content(a)$StateResults[[1]]$Candidate$Color,content(a)$StateResults[[2]]$Candidate$Color,content(a)$StateResults[[3]]$Candidate$Color) | |
rar=round(arr,3)*100 | |
barplot(arr,names.arg=nam,col=colr) |
library(raster) | |
library(jpeg) | |
# Spherical environment mapping hillshade function | |
getv=function(i,a,s){ | |
ct = dim(i)[1:2]/2 | |
sx = values(s)/90 * ct[1] | |
sy = values(s)/90 * ct[2] | |
a = values(a) * 0.01745 | |
px = floor(ct[1] + sx * -sin(a)) |
## Load required packages | |
# you will need to install these, first do | |
# eg. install.packages("tidyverse") | |
# etc. to install them one by one | |
library(tidyverse) | |
library(httr) | |
library(sf) | |
library(tmap) |
data = tibble(foo=c("Bah","Fuzz")) | |
my_column="foo" | |
data %>% filter(!!my_column := "Bah") |
library("reticulate") | |
library(tidyverse) | |
library(purrr) | |
# We use the python "holidays" package for the basic holidays | |
# Installed it using pip first | |
holidays <- import("holidays") | |
tas_holidays <- holidays$Australia(prov="TAS") | |
# List of all dates from 2000 to 2018 |
# Demonstration - Downloading and animating ACCESS forecast data | |
# [email protected] | |
# General functions, including str_replace, map | |
library(tidyverse) | |
# threddscrawler is a useful package for parsing THREDDS data servers | |
# Install it with: | |
# devtools::install_github("BigelowLab/threddscrawler") | |
library(threddscrawler) |