# install the development version
# install.packages("pak")
# pak::pak("r-arcgis/arcgislayers")
library(pillar)
# for authorizing to your portal
library(arcgisutils)
#>
#> Attaching package: 'arcgisutils'
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
# What do i want from an object oriented R class system? | |
# opt-in public immutability - neither. Accomplished with private property with active binding in R6 | |
# interior mutability - R6 | |
# type safety - S7 | |
# self-referential methods - R6 | |
# private methods don't have any type safety they can be whatever you want. | |
# immutables can only be set at creation and class doesn't matter | |
# Each .public & .private element must be named |
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
# remotes::install_github("simonpcouch/forested") | |
library(dplyr) | |
library(sfdep) | |
library(spdep) | |
trees <- forested::forested |> | |
sf::st_as_sf(coords = c("lon", "lat"), crs = 4326) | |
k <- ceiling(nrow(trees)^(1/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
[package] | |
name = "testthat-cli" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
argh = "0.1.12" |
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
#' @export | |
new_schedule_builder <- function() { | |
builder <- list( | |
sec = "0", | |
min = "0", | |
hour = "0", | |
dom = "*", | |
month = "*", | |
dow = "*", | |
year = "*" |
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(dplyr) | |
library(tidyr) | |
library(ggplot2) | |
url <- "https://projects.fivethirtyeight.com/polls/president-general/2024/national/polls.json" | |
# read in the raw json path | |
polls_raw <- RcppSimdJson::fload(url) | |
# filter to the IDs that contain Harris |
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
// Place your key bindings in this file to override the defaults | |
[ | |
{ | |
"key": "shift+cmd+b", | |
"command": "workbench.action.tasks.runTask", | |
"args": "Build R package", | |
"when": "isRPackage" | |
}, | |
{ | |
"key": "shift+cmd+enter", |
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
#!/usr/bin/env Rscript | |
# we need to vendor the dependencies and then store the checksum | |
rextendr::vendor_pkgs() | |
# make the checksum | |
# writeLines( | |
# tools::md5sum("src/rust/vendor.tar.xz"), | |
# "./tools/vendor.md5" | |
# ) |
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
[package] | |
name = "json-parser" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
serde = { version = "1.0.199", features = ["derive"] } | |
serde_json = "1.0.116" |
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
FROM python:3.9-bookworm | |
ENV R_VERSION=4.3.3 | |
# Install from Posit binaries | |
# https://docs.posit.co/resources/install-r/#verify-r-installation | |
RUN apt-get update && \ | |
apt-get install -y gdebi-core curl && \ | |
curl -O https://cdn.rstudio.com/r/debian-12/pkgs/r-${R_VERSION}_1_amd64.deb && \ | |
gdebi -n r-${R_VERSION}_1_amd64.deb && \ |
NewerOlder