[R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread Mark Knecht
Hi, I am apparently not understanding some nuance about either the use of subset or more likely my ability to test for a numerical match using '='. Which is it? Thanks in advance. I've read a data file, reshaped it and then created MyResults by keeping only lines where the value column is

Re: [R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread Henrique Dallazuanna
Try this: MyResults.GroupA - subset(MyResults, PosType == 1) On Tue, Jul 7, 2009 at 4:06 PM, Mark Knecht markkne...@gmail.com wrote: Hi, I am apparently not understanding some nuance about either the use of subset or more likely my ability to test for a numerical match using '='. Which

Re: [R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread Jorge Ivan Velez
Hi Mark, X = 1 assings the number 1 to X whereas X == 1 test if X is equal to 1. I suspect you want to do this :-) Here is an example: # R code X = 1 X # [1] 1 X == 1 # [1] TRUE HTH, Jorge On Tue, Jul 7, 2009 at 3:06 PM, Mark Knecht markkne...@gmail.com wrote: Hi, I am apparently

Re: [R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread Duncan Murdoch
On 7/7/2009 3:06 PM, Mark Knecht wrote: Hi, I am apparently not understanding some nuance about either the use of subset or more likely my ability to test for a numerical match using '='. Which is it? Thanks in advance. I've read a data file, reshaped it and then created MyResults by

Re: [R] Test for X=1 fails, test for 0 works, data in text file

2009-07-07 Thread Ted Harding
On 07-Jul-09 19:06:59, Mark Knecht wrote: Hi, I am apparently not understanding some nuance about either the use of subset or more likely my ability to test for a numerical match using '='. Which is it? Thanks in advance. It looks as though you have tripped over the distinction between =

Re: [R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread Mark Knecht
On Tue, Jul 7, 2009 at 12:17 PM, Henrique Dallazuannawww...@gmail.com wrote: Try this: MyResults.GroupA - subset(MyResults, PosType == 1) SNIP Darn those small screen fonts. I never noticed that! Every example I'm looking at jsut looks like a single '=' until you pointed it out! Thanks to

Re: [R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread William Dunlap
subset(), like many R methods, has an argument list that ends with '...', meaning that it will not tell you that an argument you gave it by name= is not in the official list of arument names. If the ... were not there then you would have gotten an error message. E.g., the following makes a