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
png(filename = "Figures/web.R.png", width = 28, height = 21, units = "cm", res = 100) | |
#plotweb(mat, text.rot = 55, col.high = NULL, col.low = NULL, low.lablength = 7, labsize = 2) | |
dev.off() |
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
BEGIN { | |
FS = "\t" | |
} | |
## should be possible to catch logs & other extras by finding unsplit lines | |
{ | |
n = split($2, lines, /[A-Z]'?[A-Z][A-Za-z'\[\] ]*:/, speaker) | |
if (n == 1) { | |
printf "%s\t%s\t%s\t%s\n", $1, 1, "extra", $2 |
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
source("fn.incidence.R") | |
insect<-read.csv("insect.community.csv",sep=";") | |
brom<-read.csv("bromeliads.csv") | |
insect.pres <- insect | |
insect.pres[,3:27] <- as.numeric(insect.pres[,3:27]>0) | |
taxo.insect <- read.csv("Cardoso.insects.csv",sep=";") | |
insect.common <- commonize() | |
a.b <- sapply(1:dim(insect.common)[1],log.reg,simplify=FALSE) | |
a.b <- do.call(cbind,a.b) |
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
BEGIN {FS = "," | |
genus = "0"} | |
$1 ~ /[A-Z][a-z]/ {genus = $1} | |
{ | |
$2 = genus | |
printf "%s %s\n", $1, $2 | |
} |
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
## create the logical matrices for subsetting | |
## x matrix to subset | |
## n number of rows or columns in each subset (by subset I mean a small square from the larger matrix) | |
select_matrix <- function(x, n){ | |
mod <- ncol(x) %% n | |
if(mod != 0) stop("not a divisor") | |
if(ncol(x) != nrow(x)) stop("not a square") | |
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
print_num <- function(num){ | |
print(num) | |
} | |
print_num_x <- function(num = x){ | |
print(num) | |
} |
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
require("yaml") | |
require("lubridate") | |
#' Make a correct SWC blog post | |
#' | |
#' Automatically formats the necessary YAML header for a | |
#' Software Carpentry Teacher training blog post. Writes | |
#' this header to a file with the correct name. The file is | |
#' created in your current working directory. | |
#' |
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
#' convert positional information to two columns | |
#' | |
#' Sometimes text is organized by position. This function | |
#' turns positional group labels (e.g headers ) into the levels of a grouping variable | |
#' @param x character vector containing group labels followed by group members | |
#' @param pattern regular expression that identifies the group labels | |
fill_down <- function(x, pattern){ | |
## find matches of the pattern | |
x <- as.character(x) | |
value_matches <- grepl(pattern = pattern, x = x) |
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
Installing package into ‘/home/andrew/R/x86_64-pc-linux-gnu-library/3.1’ | |
(as ‘lib’ is unspecified) | |
* installing *source* package ‘RTidyHTML’ ... | |
cc -Iinclude -fPIC -c -o access.o access.c | |
cc -Iinclude -fPIC -c -o alloc.o alloc.c | |
cc -Iinclude -fPIC -c -o attrask.o attrask.c | |
cc -Iinclude -fPIC -c -o attrdict.o attrdict.c | |
cc -Iinclude -fPIC -c -o attrget.o attrget.c | |
cc -Iinclude -fPIC -c -o attrs.o attrs.c | |
cc -Iinclude -fPIC -c -o buffio.o buffio.c |
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
make -Bnd | make2graph -s | circo -Tpng -o out_circ.png |