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
| # get the dates of all emails with a certain search string, and plot | |
| # install.packages(c("gmailr", "lubridate", "tidyverse")) | |
| suppressPackageStartupMessages(library(gmailr)) | |
| suppressPackageStartupMessages(library(tidyverse)) | |
| archy_109 <- | |
| messages( | |
| search = 'ARCHY 109', | |
| num_results = 1000, |
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
| # load the libraries | |
| library(tidyverse) | |
| library(readxl) | |
| # load the data | |
| pottery <- | |
| read_excel("data/HTSKY-RIM.xlsx", | |
| col_types = "text") |
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(ggplot2) | |
| # coords for vertices of polygons that make the zones | |
| polydata <- rbind( | |
| data.frame(x = c(0, 0.01, 0.99, 1), | |
| y = c(0, 0.25, 0.25, 0), | |
| group = "zone 1", | |
| fill = "grey80", xc = .5, yc = 0.125), | |
| data.frame(x = c(0, 0.025, 0.495, 0.495), | |
| y = c(-0.01, -0.25, -0.25, -0.01), |
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("googlesheets") | |
| suppressPackageStartupMessages(library("dplyr")) | |
| third_party_gap <- "https://docs.google.com/spreadsheets/d/1xbMp7UZ7Nusjb2u1b1RihZrNzPMINZ8BHy9x2urGTzo/edit#gid=0" %>% | |
| gs_url() | |
| wp <- | |
| third_party_gap %>% | |
| gs_read(ws = "Writing progress") |
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
| # related to my question here: https://github.com/tidyverse/googledrive/issues/218 | |
| # How to get access to specific revisions of a google drive document? Yes, we can do that. | |
| # How to get the username for each revision, and the size of the document at each revision (bytes or words, assuming we are specifically talking about docs and not sheets or other types of files) Yes, we can do that. | |
| # Goal is to measure the contributions of each author to a collaboratively-authored google doc with as little work as possible | |
| # How to get access to specific revisions of a google drive document? | |
| # Getting the revisions for a Google Doc |
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
| # to make traces... | |
| # Import an EPS file in Inkscape | |
| # Trace over it to show half of vessel profile, from top of rim to centre of base, about 20-30 segements | |
| # detelete EPS from from Inkscape | |
| # export PNG of trace from Inkscape | |
| library(magick) | |
| lf <- list.files("../traces", full.names = TRUE) |
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
| # read in the images... | |
| library(magick) | |
| img_paths <- list.files("../outline_P/", full.names = TRUE ) | |
| n <- 100 # just get a sample | |
| imgs <- image_read(img_paths[1:n]) | |
| # reduce size | |
| imgs_cropped <- image_crop(imgs, "100x100") |
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
| # Change point analysis | |
| library(tidyverse) | |
| # get the data of population per state and fatalities per state | |
| source(here::here("/Analysis/Tables/permillcalculation.R")) | |
| # compute fatalities per 1000 peple per year per state, using | |
| # the custom function in permillcalculation.R | |
| ratio_data <- permillcalc() |
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
| # data.frame to be filled | |
| wf_df <- data.frame() | |
| # effective population sizes | |
| sizes <- c(5, 10, 100, 500) | |
| # starting allele frequencies | |
| starting_p <- c(.01, .1, .5, .8) | |
| # number of generations |
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(sf) | |
| library(tidyverse) | |
| # read in the shapefile first, that gives us the CRS for the analysis | |
| polygons <- st_read("polygons.shp") | |
| # read in the points | |
| points <- read_csv('points.csv') |