Re: [R] File checking problem‏

2009-03-06 Thread ling ling
HI,Barry. Thanks a lot for your details reply. I have already rewritten the programs. Now it totally works. Your comment: " Note the use of comments and breaking the code up into small independent, testable functions" is really Valuable! Thanks again. Hi,David, You are right, My previous c

Re: [R] File checking problem

2009-03-05 Thread Barry Rowlingson
2009/3/5 ling ling : > > Dear all, > > I am a newcomer to R programming, I met the problem: > > I have a lot of .txt files in my directory. > > Firstly, I check whether the file satisfies the conditions: > 1.empty > 2.the "Rep" column of the file has no "useractivity_idle" or > "useractivity_act" >

[R] File checking problem

2009-03-05 Thread ling ling
Dear all, I am a newcomer to R programming, I met the problem: I have a lot of .txt files in my directory. Firstly, I check whether the file satisfies the conditions: 1.empty 2.the "Rep" column of the file has no "useractivity_idle" or "useractivity_act" 3.even The "rep" has both of them, numb

Re: [R] File checking

2009-03-05 Thread jim holtman
?file.info On Thu, Mar 5, 2009 at 7:43 AM, ling ling wrote: > > Hello, > > How can I check if file is empty in R, if it is, then jump out and read next > file; if it isn't, then read through? > > Thanks a lot for any help. > > Tammy > > ___

Re: [R] File checking

2009-03-05 Thread Gabor Grothendieck
Try this: file.info("empty.txt")$size == 0 On Thu, Mar 5, 2009 at 7:43 AM, ling ling wrote: > > Hello, > > How can I check if file is empty in R, if it is, then jump out and read next > file; if it isn't, then read through? > > Thanks a lot for any help. > > Tammy > > _

[R] File checking

2009-03-05 Thread ling ling
Hello, How can I check if file is empty in R, if it is, then jump out and read next file; if it isn't, then read through? Thanks a lot for any help. Tammy _ More than messages–check out the rest of the Windows Live™. http://www.