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(pdftools) | |
# finds files in current directory | |
pdfs <- list.files(pattern = "pdf", full.names = TRUE) | |
# uses pdftools to convert pdfs to plain-text, replaces line breaks with spaces | |
# and then counts the words, ignoring non-word symbols | |
readCleanCount<-function(pdf){ | |
txt<-pdf_text(pdf) | |
txt<-paste(gsub(txt,pattern="\r\n",replace=" "),collapse=" ") |
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
#So here's an example of that | |
x<-rnorm(100) | |
y<-rnorm(100) | |
z<-rnorm(100) | |
xy<-x+2*y+rnorm(100) | |
# everything needs to be in a dataframe | |
data<-data.frame(xy,x,y,z) |
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
# x is the score for the horizontal axis, xx is the loading for that axis | |
# y is the score for the vertical axis, yy is the loading for that axis | |
# and the labels for each can also be set | |
myBiPlot<-function(x,y,xx,yy | |
,xlab="",ylab="" | |
,xxlab="",yylab=""){ | |
oldPar<-par(no.readonly=TRUE) | |
par(mar=c(5,5,5,5)) | |
# |
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
# for nest migrations - source functions, modify vectors of lists of nesting species, then run | |
# use kable to produce markdown table for pasting to Silph Road | |
#approximate ranges for each species in the nesting lists | |
getRangesForNestingSpecies<-function(nestingSpecies, arbMax=256){ | |
nNesting<-length(nestingSpecies) | |
intLength<-arbMax/nNesting | |
lowBound<-((1:nNesting)-1)*intLength | |
upperBound<-lowBound+intLength | |
res<-cbind(lowBound,upperBound) |
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
# for nest migrations - source functions, modify vectors of lists of nesting species, then run | |
# use kable to produce markdown table for pasting to Silph Road | |
#approximate ranges for each species in the nesting lists | |
getRangesForNestingSpecies<-function(nestingSpecies, arbMax=256){ | |
nNesting<-length(nestingSpecies) | |
intLength<-arbMax/nNesting | |
lowBound<-((1:nNesting)-1)*intLength | |
upperBound<-lowBound+intLength | |
res<-cbind(lowBound,upperBound) |
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
setwd("D:\\dave\\fun\\Pokemon\\analyses of pokemon stuff\\PvP Analysis") | |
# CP_multiplier | |
CP_multiplier<-c(0.094, 0.135137432, 0.16639787, 0.192650919, 0.21573247, 0.236572661, | |
0.25572005, 0.273530381, 0.29024988, 0.306057377, 0.3210876, 0.335445036, 0.34921268, | |
0.362457751, 0.37523559, 0.387592406, 0.39956728, 0.411193551, 0.42250001, 0.432926419, | |
0.44310755, 0.453059958, 0.46279839, 0.472336083, 0.48168495, 0.4908558, 0.49985844, | |
0.508701765, 0.51739395, 0.525942511, 0.53435433, 0.542635767, 0.55079269, 0.558830576, | |
0.56675452, 0.574569153, 0.58227891, 0.589887917, 0.59740001, 0.604818814, 0.61215729, |
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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="generator" content="pandoc" /> |
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
devtools::install_github("dwbapst/paleotree", ref="dev_refinedphylopicfun") | |
library(paleotree) | |
taxaSeventyEight <- c( | |
"Archaeopteryx", "Pinus", "Procoptodon", "Olenellus", "Eldredgeops", | |
"Quetzalcoatlus", "Homo", "Tyrannosaurus", "Triceratops", "Giraffa", | |
"Bolivina", "Cancer", "Dicellograptus", "Dunkleosteus", "Solanum", | |
"Anomalocaris", "Climacograptus", "Halysites", "Cyrtograptus", | |
"Procoptodon", "Megacerops", "Moropus", "Dimetrodon", "Lingula", |
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(paleotree) | |
#Simulate some fossil ranges with simFossilRecord | |
set.seed(444) | |
record<-simFossilRecord(p=0.1, q=0.1, nruns=1, | |
nTotalTaxa=c(30,40), nExtant=0) | |
taxa<-fossilRecord2fossilTaxa(record) | |
#simulate a fossil record with imperfect sampling with sampleRanges | |
rangesCont <- sampleRanges(taxa,r=0.5) |
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
filename <- "remove_pika_aipom" | |
# remove taxa | |
removeTaxa <- c("Pikachu", "Aipom") | |
#################################### | |
################################### |
OlderNewer