# Load packages
setwd(wd) # assumes wd has been set earlier in the doc
require(knitr)
require(markdown)
# process .md and .pdf files (including smart punctuation and grey background of code blocks)
filen <- "names" # name of this markdown file without suffix
knit(paste0(filen,".md"))
system(paste0("pandoc -s ", paste0(filen,"-out.md"), " -t latex -o ", paste0(filen,".pdf"), " --highlight-style=tango -S"))
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
# R script for plotting of basic lithic data from Gua Mo'o hono, Sulawesi | |
#### get data | |
# this block will connect to the internet to access our google sheet | |
# then download it directly into a dataframe ready to work on | |
# If this is the first time, a little preparation is necessary: | |
# In google sheet: File -> Publish to web -> publish all sheets; | |
# Get link to published data -> CSV, all sheets, copy-paste link here... | |
# make a list of the links to all our sheets... |
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
dfr <- c("2013.6.4.usytW8LZ", | |
"2013.1.1.E84E4jrp", | |
"2012.12.18.98btEyuG", | |
"2013.4.18.N45CdU3m", | |
"2013.4.20.FxFmBVYd", | |
"2013.4.29.jWU8ZEvg", | |
"2013.5.8.g6VTxDs5", | |
"2013.5.15.JkRSEQce") | |
# allocate list to hold results of loop... |
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
############################################################ | |
# Analysis of camsizer data on sediment samples | |
# | |
# clear the workspace | |
rm(list = ls()) | |
# See the bottom to import data if you're coming back | |
# after having done all this previously, if this is the first | |
# run, carry on from here! | |
# | |
# Tell R where to look for the .xls data files, change this |
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.tps = function(data) { | |
# Reads the .tps file format produced by TPSDIG | |
# (http://life.bio.sunysb.edu/morph/ into a single data frame | |
# USAGE: R> read.tps("filename.tps") | |
a = readLines(data) # so we can do some searching and indexing | |
LM = grep("LM", a) # find the line numbers for LM | |
ID.ind = grep("ID", a) # find the line numbers for ID | |
# and the ID values, SCALE values, and image names | |
ID = gsub("(ID=)(.*)", "\\2", grep("ID", a, value=T)) | |
SCALE = gsub("(SCALE=)(.*)", "\\2", grep("SCALE", a, value=T)) |
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
## 3D model geometric morphometry | |
# start with NextEngine 3D scanner, acquire model and save in PLY format | |
# open PLY file in IDAV's free Landmark software and place landmarks | |
# export landmark point co-ords as a PTS file, then continue here: | |
## read in pst files of landmark co-ord that were made by Landmark (http://www.idav.ucdavis.edu/research/EvoMorph) | |
# placing landmarks can be done in R with 'shapes' or 'geomorph', but is easier with Landmark | |
# get file names |
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
# sources: | |
# http://www.jgoodwin.net/?p=1223 | |
# http://orgtheory.wordpress.com/2012/05/16/the-fragile-network-of-econ-soc-readings/ | |
# http://nealcaren.web.unc.edu/a-sociology-citation-network/ | |
# http://kieranhealy.org/blog/archives/2014/11/15/top-ten-by-decade/ | |
# http://www.jgoodwin.net/lit-cites.png | |
########################################################################### | |
# This first section scrapes content from the Web of Science webpage. It takes |
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
# In a terminal... make sure I get the master branch | |
git clone -b master git://github.com/JuliaLang/julia.git | |
# needed these on EC2 | |
sudo apt-get update | |
sudo apt-get install gcc | |
sudo apt-get install g++ | |
sudo apt-get install gfortran | |
sudo apt-get install make |
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
Quick look at 'Off Our Backs' with some of text mining functions in the R package [JSTORr][id1] | |
======================================================== | |
Here I demonstrate some basic text mining of a selection of articles from 'Off Our Backs' that are held by JSTOR. I was motivated by [this blog post][id]. I tried with all articles that are one or more pages, but that resulted in some corrupt data (empty CSV files), so the data here are all articles with two or more pages. The methods here come from the R package [JSTORr][id1] and use the article as the basic unit of analysis. The motivation for this is that [JSTOR's DFR][id2] data are provided at the article level, and that does seem to provide interesting data at the scale of multiple thousands of articles. However, this is a lower level of resolution than corpus linguistics methods that use the word as the unit of analysis. So the results here might not compare well with corpus linguistics methods for a small sample of articles. | |
```{r, echo=TRUE, messag |
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
Citation Network Analysis | |
======================================================== | |
1. Go to http://apps.webofknowledge.com.offcampus.lib.washington.edu/ | |
2. click the 'web of science' tab at the top | |
3. Do a search... refine search by journal... perhaps archaeolog* in 'publication title', hit 'search' | |
4. scroll to bottom of search results, where 'Output Records' section is | |
5. Select records -> 1-500 since 500 is max | |
6. Select content -> Full Record & Cited References |