docker pull ghcr.io/rocker-org/verse:4.3.3
docker run --rm -ti ghcr.io/rocker-org/verse:4.3.3 bash
quarto create project book abook
cd abook
## I turned off PDF rendering in _quarto.yml because lots of deps
quarto render
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
# distribution of null p-values in binomial glm | |
library(rethinking) | |
# t test | |
# pval has uniform distribution under null | |
f <- function(N=10) { | |
y1 <- rnorm(N) | |
y2 <- rnorm(N) |
The KX3 transceiver is designed for HF amateur band operation. The KX3 natively supports 160m - 6m.
An optional 2m accessory can extend the band support to 2m, though the installation of that accessory is a more intensive, electronics hobbyist task.
As with all radios, do not transmit when the antenna is disconnected. Avoid touching the antenna or feed line when transmitting. Power down the radio and disconnect the feed line when making antenna adjustments.
❯ usethis::use_pkgdown_travis()
✔ Setting active project to '/Users/gaborcsardi/works/ps'
✔ Adding 'docs/' to '.gitignore'
● Set up deploy keys by running `travis::use_travis_deploy()`
● Insert the following code in '.travis.yml'
before_cache: Rscript -e 'remotes::install_cran("pkgdown")'
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 that outputs a graph | |
library(tidyverse) | |
library(firatheme) | |
wine <- read_delim("https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data", | |
delim = ",", | |
col_names = c( | |
"Cultivar", "Alcohol", "Malic acid", "Ash", "Alcalinity of ash", "Magnesium", | |
"Total phenols", "Flavanoids", "Nonflavanoid phenols", "Proanthocyanins", | |
"Color intensity", "Hue", "OD280/OD315", "Proline" | |
) |
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
{ | |
"styler::style_active_file": "Ctrl+Y", | |
"addmins::insert_dashes": "Ctrl+8", | |
"xaringan::inf_mr": "Ctrl+M", | |
"drake::rs_addin_loadd": "Ctrl+K", | |
"browse::browse": "Ctrl+B" | |
} |
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) | |
st_queen <- function(a, b = a){ | |
st_relate(a, b, pattern = "F***T****") | |
} | |
new_data <- original_data %>% | |
mutate(neighbors = st_queen(.)) %>% | |
st_drop_geometry() %>% |
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
st_recenter <- st_recentre <- function(x, clon = NULL, ..., tryfix = TRUE) { | |
if (is.null(clon)) return(x) | |
if (!st_is_longlat(x)) stop("recentring not appropriate for non longlat data") | |
## try to fix problematic geometry | |
if (tryfix) { | |
if (all(grepl("POLYGON", st_geometry_type(x)))) x <- suppressWarnings(st_buffer(sf::st_as_sf(x), 0)) | |
x <- st_wrap_dateline(x, options = c("WRAPDATELINE=YES", "DATELINEOFFSET=180")) | |
} | |
wbox <- st_as_sfc(st_bbox(c(xmin = -180, ymin = -90, xmax = (clon)%%360 - 180, ymax = 90), crs = st_crs(x))) | |
west <- suppressWarnings(st_intersection(x, wbox)) |
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
# tidy_rcarbon.R | |
# Tidy wrappers for the rcarbon package | |
#' Calibrate radiocarbon dates with tidy syntax | |
#' | |
#' A thin wrapper of [rcarbon::calibrate()] that returns calibrated dates as a | |
#' single list rather than a `CalDates`` object. Useful, for example, if you want | |
#' to add a column of calibrated dates to an existing table with [dplyr::mutate()] | |
#' | |
#' @param cra A vector of uncalibrated radiocarbon ages. |
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) | |
the_pages <- c( | |
"https://en.wikipedia.org/wiki/Angela_McGowan", | |
"https://en.wikipedia.org/wiki/Caroline_Bird_(archaeologist)", | |
"https://en.wikipedia.org/wiki/Jo_McDonald", | |
"https://en.wikipedia.org/wiki/Laurajane_Smith", | |
"https://en.wikipedia.org/wiki/Louise_Zarmati", | |
"https://en.wikipedia.org/wiki/Marcia-Anne_Dobres", | |
"https://en.wikipedia.org/wiki/Sarah_Colley", |
NewerOlder