Re: [R] problem with grep under loop

2013-09-17 Thread capricy gao
Thanks a lot. It works great now! Cc: R help Sent: Friday, September 13, 2013 11:46 PM Subject: Re: [R] problem with grep under loop Hi, dat1<- read.table("gao.txt",sep="",header=FALSE,stringsAsFactors=FALSE)  dat1 #

Re: [R] problem with grep under loop

2013-09-16 Thread MacQueen, Don
C.4.1 100 1.00 0.00 >5 - - u C.1 C.1.1 100 1.00 0.00 >6 - - u C.5 C.5.1 100 1.00 0.000000 > V9 V10 V11 V12 V13 >1 FPKM_conf_hi cov len major_iso_id ref_match_len

Re: [R] problem with grep under loop

2013-09-13 Thread arun
Hi, dat1<- read.table("gao.txt",sep="",header=FALSE,stringsAsFactors=FALSE)  dat1 #   V1 V2 V3   V4  V5  V6   V7   V8 #1 ref_gene_id ref_id class_code cuff_gene_id cuff_id FMI FPKM FPKM_conf_lo #2   -  -  u  C.3   C.3.1 100

Re: [R] problem with grep under loop

2013-09-13 Thread capricy gao
and it looks ok. However, when I put it in for loop, error message came: argument is of length zero Could you please help me figure out what happened here? Thanks a lot for your help. From: Jeff Newmiller ect.org> Sent: Friday, September 13, 2013 10:36 PM Su

Re: [R] problem with grep under loop

2013-09-13 Thread Jeff Newmiller
.00 0.059634 101 C.5.1     - > > >____ > From: Jeff Newmiller >To: capricy gao ; capricy gao ; >"r-help@r-project.org" >Sent: Friday, September 13, 2013 9:21 PM >Subject: Re: [R] problem with grep under loop > > >

Re: [R] problem with grep under loop

2013-09-13 Thread capricy gao
C.2.1 - 4 0.00 0.059634 101 C.4.1 - 5 0.00 0.059634 101 C.2.1 - 6 0.00 0.059634 101 C.5.1 - From: Jeff Newmiller h...@r-project.org" Sent: Friday, September 13, 2013 9:21 PM

Re: [R] problem with grep under loop

2013-09-13 Thread Jeff Newmiller
This is because you are not printing it (with the print or cat functions). Keep in mind that the visible result you get from calling a function or evaluating a variable interactively comes from the interactive R command line, not from R itself. Once you put such an expression inside a function (

Re: [R] problem with grep under loop

2013-09-13 Thread arun
Hi, Try: for(i in 1:10) {print(grep("a",letters))} [1] 1 [1] 1 [1] 1 [1] 1 [1] 1 [1] 1 [1] 1 [1] 1 [1] 1 [1] 1 x<- vector()  for(i in 1:10) {x[i]<-grep("a",letters) }  x # [1] 1 1 1 1 1 1 1 1 1 1 A.K. - Original Message - From: capricy gao To: "r-help@r-project.org" Cc: Sent: Frida

Re: [R] problem with grep under loop

2013-09-13 Thread David Winsemius
Wrap a print or cat function around it. Sent from my iPhone On Sep 13, 2013, at 6:29 PM, capricy gao wrote: > > > I am just testing the possibility of using grep under for loop: > >> for(i in 1:10){grep("a",letters)} > > > nothing came out; > > when I ran: > > >> grep("a",letters), >

Re: [R] Problem with Grep Under Loop

2008-10-06 Thread Gustaf Rydevik
On Mon, Oct 6, 2008 at 2:16 PM, Gundala Viswanath <[EMAIL PROTECTED]> wrote: > Dear all, > > This is the sample of the source data (tab delimited) > > http://dpaste.com/82660/plain/ > > - Gundala Viswanath > Jakarta - Indonesia > Hi, using this data, your original code works flawlessly - nothing

Re: [R] Problem with Grep Under Loop

2008-10-06 Thread Gundala Viswanath
Dear all, This is the sample of the source data (tab delimited) http://dpaste.com/82660/plain/ - Gundala Viswanath Jakarta - Indonesia On Mon, Oct 6, 2008 at 9:05 PM, Gustaf Rydevik <[EMAIL PROTECTED]> wrote: > On Mon, Oct 6, 2008 at 1:37 PM, Gundala Viswanath <[EMAIL PROTECTED]> wrote: >> De

Re: [R] Problem with Grep Under Loop

2008-10-06 Thread Gustaf Rydevik
On Mon, Oct 6, 2008 at 1:37 PM, Gundala Viswanath <[EMAIL PROTECTED]> wrote: > Dear all, > > I have no problem with this individual grep command: > >> datk <- grep("XM_528056", source$V1) >> dat2 <- source[datk,] >> print(dat2) > V1 V2 V3 V4 V5 V6 V7 > 35995 XM_

Re: [R] Problem with Grep Under Loop

2008-10-06 Thread jim holtman
Seems to work fine for me. You need to read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. You did not provide 'source', so I created one and it seems to work. So I have to conclude you have something wrong in your d