haotu : an open lab notebook


endnote place references in different places :: endnote move references in different places

Filed under: Uncategorized — S @ 02:40

Just move the bibliography (select + cut/paste or drag) to where you want it in your document. Existing and future references will be listed together at this point, as you’ve now moved the target document-location for the bibliography.





make selected columns of a dataframe into numeric vectors

Filed under: Uncategorized — S @ 04:21

combs1 <- apply(combs[,1:5], 2, as.numeric)

combs[,1:5] <- combs1



Shorthand methods for model selection in R with step | Model selection with a lot of independent variables to start

Filed under: errors in R, R — S @ 02:44

Make sure data frame includes both dependent and independent variables.

Model code becomes:

glm1 <- glm(Y ~ ., data=kk[, 24:60], family=gaussian)

# use (data=) to select the columns of the data frame, kk, that have both independent and dependent variables in them.  The period after ~ includes all of the columns you indicate in data.

Then proceed with step() or stepAIC() to do model selection.


This post is from an avid follower of haotu

in R there are so many times for loops fail due to function fails within the loop

Filed under: errors in R, R — S @ 02:03



for (i in 1:10)



#Do some awesome function



#this results in an error likely since one o the steps of the data set you are processing is not consistent with the other 10 steps.


#what step is in error??

for (i in 1:10){try(k)}

try might fix your problem but the steps in the original data set are still not consistent.


Write a file to the clipboard | Cut and paste R objects

Filed under: Uncategorized — S @ 01:06

There are many times when I want to go from R to a text editor. Unfortunately, the following method only works for windows. it would be nice if someone knew of a way to do it in a Lynux system.

if dat is your data matrix


to copy from R


to paste to R

You may also need to close all connections before this works, and possibly output dat so you see it in the command line



Here is a function that seems to work on my system all the time.

clipboard<-function()  ...  coming soon

Create a free website or blog at WordPress.com.