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
% =============== | |
% = Bookkeeping = | |
% =============== | |
% Equation 3: average respiration | |
R_{\mu} = \frac{\sum\limits_{i=1}^{n} \Delta DO_i - F_i}{n \Delta t} | |
NEP = \frac{NEP_t (\text{mg O}_2 \text{ L}^{\text{-}1} \Delta t)} {1} | |
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
png(file="~/Desktop/figure.png", width=3.5, height=3.5, res=150, units="in") # open / setup device | |
par( | |
mar=c(1.75, 1.75, 0.1, 0.1), # panel magin size in "line number" units | |
mgp=c(1, 0.1, 0), # default is c(3,1,0); line number for axis label, tick label, axis | |
tcl=-0.1, # size of tick marks as distance INTO figure (negative means pointing outward) | |
cex=1, # character expansion factor; keep as 1; if you have a many-panel figure, they start changing the default! | |
ps=8, # point size, which is the font size | |
family="sans" |
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 is what 'test' looks like: | |
# > test | |
# s.reg year num nameID stratum lon lat btemp depth N Nsite spp Z u.a0 a1 a2 | |
# 1: ebs 1982 12 ebs_1982_12 -158.5 57.5 -158.5 57.5 -0.16 34.4 919.4999 83 Acantholithodes hispidus 0 -2.807526 0.60290095 -0.1560553 | |
# 2: ebs 1982 12 ebs_1982_12 -158.5 57.5 -158.5 57.5 -0.16 34.4 919.4999 83 Acantholumpenus mackayi 0 -4.294548 0.66363085 -0.1244255 | |
# 3: ebs 1982 12 ebs_1982_12 -158.5 57.5 -158.5 57.5 -0.16 34.4 919.4999 83 Actinauge verrilli 0 -2.763588 0.67887606 -0.1261046 | |
# 4: ebs 1982 12 ebs_1982_12 -158.5 57.5 -158.5 57.5 -0.16 34.4 919.4999 83 Admete regina 0 -3.658542 0.66688800 -0.1661476 | |
# 5: ebs 1982 12 ebs_1982_12 -158.5 57.5 -158.5 57.5 -0.16 34.4 919.4999 83 Aforia circinata 0 -9.954288 0.67970755 -0.1168343 | |
# --- |
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
zCol <- function(nCols, Z){ | |
cols <- colorRampPalette(c("#000099", "#00FEFF", "#45FE4F", "#FCFF00", "#FF9400", "#FF3100"))(nCols) | |
colVec_ind <- cut(Z, breaks=nCols) | |
colVec <- cols[colVec_ind] | |
} | |
# Example | |
X <- rnorm(1E3) | |
Y <- rnorm(1E3) | |
Z <- X*Y |
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
plot(crop(subset(soda.annMax, 5:51), extent(c(-76, -65, 36, 46))), maxnl=200, bigplot=bgplt, smallplot=smplt, axis.args=axargs, col=tim.colors(), zlim=range(values(crop(subset(soda.annMax, 5:51), extent(c(-76, -65, 36, 46)))),na.rm=T)) |
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
export PATH=$HOME/bin:$PATH | |
source ~/.bashrc | |
export PATH=$PATH:/usr/include | |
source ~/.bashrc | |
echo $PATH | |
cd | |
mkdir src |
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
## All R files that are used must be listed here: | |
packages: | |
- data.table | |
- LaF | |
- bit64 | |
- stringr | |
- stringi | |
- PBSmapping | |
- devtools |
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 Eva (foreva eva) | |
eg <- structure(c(608416320, 608416320, 608416320, 608416320, 608416320, | |
608416320, 608416320, 608416320, 608416320, 608416320, 608416320, | |
608416320, 608416320, 608416320, 608416320, 608416320, 608416320, | |
608416320, 608416320, 608416320, 608416320, 608416320, 608416320, | |
608416320, 608416320, 608416320, 608416320, 608416320, 608416320, | |
608416320, 608416320, 608416320, 608416320, 608416320, 608416320, | |
608416320, 608416320, 608416320, 608416320, 608416320, 608416320, | |
608416320, 608416320, 608416320, 608416320, 608416320, 608416320, |
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
df <- data.frame(x = rnorm(20, mean=20, sd = 10)) | |
threshold <- 25 | |
replace_val <- 0 | |
df[,"x2"] <- df[,"x"] # make them the same to start | |
df[df[,"x"] >= threshold, "x2"] <- replace_val # replace values at or above threshold with replacement value |
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
#' Read JHo | |
#' | |
#' Read in a file formatted like Jennifer's data sets | |
#' | |
#' @param file a character indicating the file name (and possibly path) | |
#' @param n_nrows integer indicating number of rows for each matrix | |
#' @param n_matrices integer indicating number of matrices in the file | |
#' @param n_comment integer indicating the number of comment lines preceding each matrix of data; should include blank lines | |
#' @param n_top_comment integer indicating the number of comment lines that are unique to the start of the file; default is 0 lines | |
#' @param ... arguments to be passed to \code{scan}, such as \code{what=numeric()} and \code{sep=","} |
OlderNewer