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
| rm(list=ls()) | |
| graphics.off() | |
| # -------------------------------------------------------------------- | |
| # The Exponential decay function | |
| # http://en.wikipedia.org/wiki/Exponential_function | |
| # a sequence of x-values from 0 to 1000 | |
| x <- seq(0, 100, length=100) |
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
| X <- cbind(1:5, 6:10) | |
| G <- 1:5 | |
| my.fun <- function(x,y){return(x+y)} | |
| # ---------------------------------- |
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
| a <- list(x=rnorm(10), y=rnorm(10), xlab = "x", ylab = "y", col = "blue", pch = 19, bty = "L", cex =2) | |
| do.call('plot', a) |
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
| rm(list=ls()) | |
| graphics.off() | |
| library(mnormt) | |
| set.seed(1) | |
| # start of notes on re-scaling | |
| #if x and y are two correlated variables with covariance matrix S then | |
| #let x.z and y.z be their independently z-score transformed values. |
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
| # some data specifying the month and year | |
| month <- c( "Sep-10", | |
| "Oct-10", | |
| "Nov-10", | |
| "Jan-11") | |
| # It would appear that strptime and related | |
| # as.POSIXct functions require there to be a | |
| # day specified. Here I prepend the month-year |
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
| # example code to reclassify existing coded data | |
| # some data | |
| mydata <- data.frame(orig.codes = c(1,1,1,2,2,3,4,4,5,6,7,7,7,8,8,9,10,10,10)) | |
| # a blank vector of NAs into which we will place the new codes | |
| mydata$new.codes <- NA * numeric(length(mydata$orig.codes)) |
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('hello world') |
NewerOlder