This file contains hidden or 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
# starting with code from | |
# https://gist.github.com/tomhopper/faa24797bb44addeba79?fbclid=IwAR3FFiHpUhTESqi_ylASZP5-zYD0lOrQyyHM2MSEvnVRCIykmjNREGTv4Uk | |
library(ggplot2) | |
library(grid) | |
library(dplyr) | |
#' Create some data to plot | |
n <- 100 | |
df <- data.frame(DateTime = seq(10, 20, length.out = 100), |
This file contains hidden or 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(gh) | |
.token = "" # get one from https://github.com/settings/tokens | |
# get all pkgs on GitHub mirror of CRAN | |
n <- 5000 # 16125 # https://github.com/cran | |
cran_repos <- gh("/users/:username/repos", | |
username = "cran", |
This file contains hidden or 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
#------------------------------------------------------ | |
# Exploring the PCA published by Prentiss (1998) to understand the | |
# usefulness of the Sullivan and Rozen debitage typology | |
# read in & tidy the data ----------------------------------------------- | |
library(tidyverse) | |
# got these data from table 7 (p. 644) of https://www.jstor.org/stable/2694112 | |
# OCR'd using https://tabula.technology/ | |
prentiss <- readr::read_csv("tabula-Prentiss 1988.csv") |
This file contains hidden or 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") | |
library("EBImage") # >= 4.19.3 | |
library(imager) | |
ui <- fluidPage(# Application title | |
titlePanel("Image outline, chords, and landmarks"), | |
This file contains hidden or 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
# https://arxiv.org/pdf/1809.09328.pdf & https://twitter.com/CT_Bergstrom/status/1035327464644333568 | |
# they use Mathematica, boo! So let's make them with R | |
# starting with https://stackoverflow.com/q/33396168/1036500 | |
library(ggplot2) | |
p <- ggplot() + | |
geom_point(data = anscombe, |
This file contains hidden or 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
# Summarising multiple metric attributes of artefacts | |
p1 <- read_excel("data/riumailuoi.xlsx", sheet = 'phase1') | |
summary_stats_table <- function(x) { | |
x %>% | |
select(Mass, | |
Length, | |
Width, | |
Thickness, |
This file contains hidden or 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
# list of lists | |
url <- "https://en.wikipedia.org/wiki/Lists_of_World_Heritage_Sites" | |
# Table of sites per country can be found at each of these pages | |
# probably the simplest entry point | |
# Africa | |
africa <- "https://en.wikipedia.org/wiki/List_of_World_Heritage_Sites_in_Africa" | |
# Americas |
This file contains hidden or 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
--- | |
title: 'C14 analysis: Coastal vs Inland' | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` | |
Import and clean the data: |
This file contains hidden or 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", |
This file contains hidden or 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) | |
base_url <- "http://academicjobs.wikia.com/wiki/Archaeology_Jobs_" | |
# starts at 2010-2011 | |
years <- map_chr(2010:2019, ~str_glue('{.x}-{.x +1}')) | |
# though it seems to start at 2007-8: https://academicjobs.fandom.com/wiki/Archaeology_07-08 | |
urls_for_each_year <- str_glue('{base_url}{years}') |