haotu : an open lab notebook


Automatic MIT License for R Packages

Filed under: errors in R, R, R Stats — Tags: , — S @ 07:01


save rda data file with compression

Filed under: errors in R, R, R, R Stats — Tags: , , , , — S @ 06:36

find non-ascii in R

Filed under: errors in R, R, R, R Stats, Uncategorized — Tags: , , , , — S @ 06:34


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.

Blog at WordPress.com.