[R] enable object name to be called as object (a dataset)

2007-09-07 Thread runner
What I am trying to do is as follows: - I have listed names of all wanted objects (datasets A,B,C... ) in current workspace as a vector: obj - c('A','B','C') - then i need to use these objects, say to extract all the 1st columns and bind to an existing dataset ('data'): for ( i in 1:3){

Re: [R] can I paste 'newline'?

2007-07-20 Thread runner
Murdoch-2 wrote: On 19/07/2007 7:41 PM, runner wrote: It is ok to bury a reg expression '\n' when using 'cat', but not 'paste'. e.g. cat ('I need to move on to a new line', '\n', 'at here') # change line! paste ('I need to move on to a new line', '\n', 'at here') # '\n' is just

[R] can I paste 'newline'?

2007-07-19 Thread runner
It is ok to bury a reg expression '\n' when using 'cat', but not 'paste'. e.g. cat ('I need to move on to a new line', '\n', 'at here') # change line! paste ('I need to move on to a new line', '\n', 'at here') # '\n' is just a character as it is. Is there a way around pasting '\n' ? Thanks a

Re: [R] regexpr

2007-07-03 Thread runner
also: mylist - c(MN,NY,FL) lapply(paste(mylist,$,sep=),regexpr,text=Those from MN:) --- runner [EMAIL PROTECTED] wrote: Hi, I 'd like to match each member of a list to a target string, e.g. -- mylist=c(MN,NY,FL) g=regexpr(mylist[1], Those from MN

[R] regexpr

2007-06-29 Thread runner
Hi, I 'd like to match each member of a list to a target string, e.g. -- mylist=c(MN,NY,FL) g=regexpr(mylist[1], Those from MN:) if (g0) { On list } -- My question is: How to add an end-of-string symbol '$' to the to-match string? so that