There is a nice example here

## 2013/07/31

## 2013/07/29

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

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.

## 2013/07/24

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

`IF(COUNTIF("X",B2:D2)>0,"TRUE","FALSE")`

## 2013/07/17

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

`library(segmented)`

```
```

`lm.nat<-lm(y~x)`

seg.nat<-segmented.lm(lm.nat,seg.Z=~x,psi=list(x=NA),control=seg.control(stop.if.error=FALSE,n.boot=0,it.max=1000))

plot(x,y)

plot(seg.nat,add=TRUE)

## 2013/07/15

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

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,]`

## 2013/07/09

### Angle axis x labels on R plot

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

:

`plot(yy,xx,xaxt="n",xlab="")`

2. Then add the axis without labels

`axis(side=1,at=xx,labels=FALSE)`

where:

`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)`

where:

`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`