View gist:2237a297a33c8cb26053a526a192333e
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(httr2) | |
library(tidyverse) | |
library(sf) | |
library(lutz) | |
library(hms) | |
req <- request("https://api2.sota.org.uk/api/") | |
# get associations so we can get their time zones via lat-long | |
resp <- req %>% |
View gist:f82e1897204df6b1023fe7e73ff50fb0
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
# This script was prepared for ARCHY 486 AU23. It will draw a plot of particle size distribution | |
# of multiple sediment samples on a log scale with major size categories indicated for easy | |
# comparison. The data should be formatted as in this sheet: | |
# https://docs.google.com/spreadsheets/d/11RfkGzjpeAT1MAt1w-L5HFgdqzX_kNcXeX3EymvIBpo/edit#gid=390081773 | |
# with column names exactly as found there. | |
# get raw data on mass of sediment in the sieves | |
sieve_measurements <- | |
lab_data_my_group %>% | |
select(sieve_starting_mass_g, |
View gist:e68faf8b7d91f9f8400bba6fc5e9fc34
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
# following example from https://tensorflow.rstudio.com/tutorials/keras/classification | |
# do these steps first : https://tensorflow.rstudio.com/install/ | |
library(keras) | |
library(tidyverse) | |
library(png) | |
library(magick) | |
# get images into R | |
imgs <- |
View gist:be0a98163192d320271ab8655c1000ad
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(rvest) | |
library(tidyverse) | |
library(lubridate) | |
# https://bringatrailer.com/electric-vehicles/?search=rivian | |
# from 11 Jan 2023 | |
url <- "~/Downloads/bat.html" |
View archy-208-module-7-bmarwick.qmd
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
--- | |
title: "Untitled" | |
format: html | |
editor: visual | |
--- | |
## Introduction | |
The aim of this report ... |
View gist:da2d99ea4dfef523e08d57f4cfeac16b
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
# This script will take a folder fill of qmd files and try to render each qmd file. | |
# If one qmd fails to render, the script will continue on to the next one. The | |
# results of all the attempts to render are collected in a data frame so we can | |
# easily inspect and find the files that failed to render We don't have to | |
# manually render individual files. | |
# How to use | |
# 1. Download all submissions from Canvas (go to assignment page, look for the | |
# download button near the speedgrader button), when it arrives on your |
View archaepaperswithcodeinsept2021.R
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
# How many articles on the list in Sept 2021? | |
# First, run some lines from archaepaperswithcode.R to create repo, | |
# then: | |
## Coerce commits to a data.frame | |
df <- as.data.frame(repo) | |
# filter rows of commits from Sept 2021 |
View scraping-pnas-titles.R
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
# JB says she searched for "archaeolog*" and "archeolog*", these return 257 results for me, | |
# much less than the 1002 we get from searching the archaeology 'keyword', e.g. | |
# https://www.pnas.org/action/doSearch?Concept=500376&Concept=500375&startPage=0&sortBy=Earliest | |
# in any case, let's start with "archaeolog*" and "archeolog*", I've copied the URL of the search | |
# results page and edited the URL to return 500 items on the first page, so we can get all results without | |
# having to scrape multiple pages of results, just to simplify the process | |
library(tidyverse) |
View gist:57d1c1ba265a2e5ab6c5f33b729b8fdd
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(textreuse) | |
# one row per student, to get the data, go to canvas -> quiz -> 'quiz stats' -> 'student analysis' | |
cnvs <- read_csv("quiz-responses-downloaded-from-canvas.csv") | |
# select only the column with the text we want to compare | |
cnvs_q5 <- | |
cnvs %>% | |
select( q5 = contains("peers' reflections")) |
View tektite-maps-sea-vietnam.R
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) | |
library(googlesheets4) | |
# get our data from google sheets, we need to: | |
# - 'publish to web' | |
# - adjust sharing settings to share with anyone | |
# I've done these, now, so it should just work: | |
my_key <- "1xUqRGnb9kwBi128cERiHkV5w4uREwl-mqAVf0jmQhhg" |
NewerOlder