Re: [R] Do you use R for data manipulation?

2009-05-07 Thread Martin Waller
+1. I worked with Matthew for a while and saw in practice just how powerful that package is. I'm surprised it isn't more widely used. Martin Tom Short wrote: Another tool I find useful is Matthew Dowle's data.table package. It has very fast indexing, can have much lower memory requirements th

Re: [R] lm, coefficient 'not defined because of singularities'? What does this mean?

2008-02-15 Thread Martin Waller
TECTED] > +44 (0)20 8525 0696 > http://www.burns-stat.com > (home of S Poetry and "A Guide for the Unwilling S User") > > Martin Waller wrote: > >> Hello, >> >> I'm doing an lm(y1~x1), no NAs in them, both of length 283. >> >> I g

[R] lm, coefficient 'not defined because of singularities'? What does this mean?

2008-02-14 Thread Martin Waller
Hello, I'm doing an lm(y1~x1), no NAs in them, both of length 283. I get out however and 'NA' for the estimate of x1 and summary gives: Residuals: Min 1Q Median 3Q Max -0.1998309 -0.0447269 -0.0006252 0.0390933 0.3141687 Coefficients: (1 not defined because of singulari

[R] (RESOLVED) Re: Removing columns that are all NA from a matrix

2008-02-14 Thread Martin Waller
Thanks to all who responded - great stuff! Martin Martin Waller wrote: > Hi, > > I guess this might be a FAQ or something, and there's probably a nice > simple way to do it, but I can't think of it: > > Given a matrix, I want to remove columns that are _entirely_

[R] Removing columns that are all NA from a matrix

2008-02-14 Thread Martin Waller
Hi, I guess this might be a FAQ or something, and there's probably a nice simple way to do it, but I can't think of it: Given a matrix, I want to remove columns that are _entirely_ filled with NAs (partial NAs are fine). How please? Thanks, Martin ___

Re: [R] Clean programming with R

2007-11-26 Thread Martin Waller
Hmm - I looked for the codetools package on the UK(London) cran site and couldn't find it - where can I find it please? Martin [EMAIL PROTECTED] wrote: >>> library(codetools) >>> findGlobals(power) > > Thanks for your answer. > In addition, findGlobals(power,FALSE) gives the list of the globals

Re: [R] update matrix with subset of it where only row names match

2007-11-15 Thread Martin Waller
jim holtman wrote: > Lets take a look at your solution: > >> mat1 <- matrix(0, nrow=10, ncol=3) >> dimnames(mat1) <- list(paste('row', 1:10, sep=''), LETTERS[1:3]) >> mat2 <- matrix(1:3, ncol=1, dimnames=list(c('row3', 'row7', 'row5'), "B")) >> mat2 > B > row3 1 > row7 2 > row5 3 >> mat1[rown

Re: [R] update matrix with subset of it where only row names match

2007-11-13 Thread Martin Waller
1))) >> indx > [,1] [,2] > [1,]32 > [2,]72 > [3,]52 >> mat1[indx] <- mat2 >> mat1 > A B C > row1 0 0 0 > row2 0 0 0 > row3 0 1 0 > row4 0 0 0 > row5 0 3 0 > row6 0 0 0 > row7 0 2 0 > row8 0 0 0 &g

[R] update matrix with subset of it where only row names match

2007-11-12 Thread Martin Waller
I guess this has a simple solution: I have matrix 'mat1' which has row and column names, e.g.: A B C row10 0 0 row20 0 0 rown0 0 0 I have a another matrix 'mat2', essentially a subset of 'mat1' where the rownames are all i

Re: [R] Is this mailing list available on/as a news group?

2007-11-11 Thread Martin Waller
Gabor Grothendieck wrote: > Try: > > http://news.gmane.org/gmane.comp.lang.r.general Fantastic - perfect. Saves my inbox filling up! Thanks Martin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

[R] Is this mailing list available on/as a news group?

2007-11-10 Thread Martin Waller
I think the subject line says it all. Martin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, r

[R] Getting at what a named object represents in a function...

2007-10-20 Thread Martin Waller
Hi, I'm pretty new to R. I have an object (say a list) and I I have a function that I call on various columns in that list (excuse terminology if it's wrong/ambiguous). Imagine its like this (actual values are unimportant) and called mylist: >mylist AB 15 25 36 48 50