[R] glob2rx function not working

2006-02-20 Thread mtb954
Dear R users, Inspired by previous list discussion of the glob2rxc function, I am attempting to create a new vector called TOTAL by summing all vectors whose names begin with ABC: TOTAL = sum(list = ls(pattern = glob2rx(ABC*))) I'm running R 2.2.1 on Windows XP. Can anyone say what I'm missing?

Re: [R] glob2rx function not working

2006-02-20 Thread Gabor Grothendieck
Your expression is trying to sum a character vector containing the names of the variables that begin with ABC. Try this and try executing each portion of it to understand it better: ABC1 - ABC2 - 1 do.call(sum, lapply(apropos(glob2rx(ABC*)), get)) # 2 On 2/20/06, [EMAIL PROTECTED] [EMAIL

Re: [R] glob2rx function not working

2006-02-20 Thread Peter Dalgaard
[EMAIL PROTECTED] writes: Dear R users, Inspired by previous list discussion of the glob2rxc function, I am attempting to create a new vector called TOTAL by summing all vectors whose names begin with ABC: TOTAL = sum(list = ls(pattern = glob2rx(ABC*))) I'm running R 2.2.1 on Windows