haotu : an open lab notebook


Simple Cholesky decomposition example

Filed under: Math and Stats — S @ 05:02

There is a nice example here

the formula

the matrix

the solution



chrome.exe still running after close :: chrome.exe is caused by cloud print

Filed under: Chrome, Cloud Print, Google, Windows 7 — S @ 03:22

I have found that even if I do not allow extensions in Chrome to run in the background (i.e., in advanced settings), that an instance of chrome.exe is still running as a process once I exit Chrome.

This instance for me was caused by Google Cloud Print. Once I removed my cloud printers, the instance went away.


Excel function analogous to R any() :: find multiple cells in an excel with same value

Filed under: Excel, Microsoft Products, R — S @ 04:34


csv file with commas in elements

Filed under: Manipulate Data in R, R — S @ 04:03

read.csv(…, colClasses=”character”)


How to do a segmented, breakpoint, two-part, N-part regression in R

Filed under: Manipulate Data in R, R, R, R Stats — S @ 04:18




Extract data from a dataframe/matrix with multiple ids :: subset data in R

Filed under: Manipulate Data in R, R — S @ 00:21

If x is an object with a column id and y is a subset list of those ids, then to extract the data from x do:

x.subset<-x[x$id %in% y,]

to do the opposite use

“%w/o%” <- function(x, y) x[!x %in% y] #– x without y

x.subset<-x[x$id %w/o% y,]


Angle axis x labels on R plot

Filed under: R, R graphics — S @ 04:13

1. First make a plot without the axis you want using xaxt="n":


2. Then add the axis without labels


side = 1 (this example is for adding labels to the x axis)

3. Finally add the text:

text(xx,par("usr")[3] - ofst, srt = g, adj = 1,labels=labs,xpd = TRUE)

par("usr")[3] gives you the y coordinate for your x axis
ofst is the offset at which you want to plot the labels away from the x axis (note the minus sign).
srt = g this gives the angle to plot the labels, I like (e.g., g = 45)
labs is a vector of your labels
xpd=TRUE plotting clipped to the figure region, also try xpd=NA

Create a free website or blog at WordPress.com.