Re: [R] glob2rx function not working

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Tue 21 Feb 2006 - 05:10:25 EST

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, mtb954@gmail.com <mtb954@gmail.com> wrote:
> 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?
>
> Thank you, Mark
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Feb 21 05:13:40 2006

This archive was generated by hypermail 2.1.8 : Tue 21 Feb 2006 - 14:38:23 EST