[R] how to delete specific rows in a data frame where the first column matches any string from a list

2009-02-06 Thread Laura Rodriguez Murillo
Hi, I'm new in the mailing list but I would appreciate if you could help me with this: I have a big matrix from where I need to delete specific rows. The second entry on these rows to delete should match any string within a list (other file with just one column). Thank you so much! Laura ___

Re: [R] how to delete specific rows in a data frame where the first column matches any string from a list

2009-02-06 Thread Wacek Kusnierczyk
Laura Rodriguez Murillo wrote: > Hi, > > I'm new in the mailing list but I would appreciate if you could help > me with this: > I have a big matrix from where I need to delete specific rows. The > second entry on these rows to delete should match any string within a > list (other file with just one

Re: [R] how to delete specific rows in a data frame where the first column matches any string from a list

2009-02-06 Thread Laura Rodriguez Murillo
Thank you. I think grep would do it, but the list of expressions I need to match is too long so they are stored in a file. So the question would be how I can tell R to look into that file to look for the expressions that I want to match. Thank you again for your help Laura 2009/2/6 Wacek Kusnier

Re: [R] how to delete specific rows in a data frame where the first column matches any string from a list

2009-02-06 Thread Wacek Kusnierczyk
Laura Rodriguez Murillo wrote: > Thank you. I think grep would do it, but the list of expressions I > need to match is too long so they are stored in a file. what does 'too long' mean? > So the > question would be how I can tell R to look into that file to look for > the expressions that I want

Re: [R] how to delete specific rows in a data frame where the first column matches any string from a list

2009-02-06 Thread Laura Rodriguez Murillo
yep, it definitely sounds like a work for perl, but I don't know perl (unfortunately). I'm still stuck with this so I'm giving more details in case it helps: I have file A with 382 columns and 30 rows. There are rows where only the entry in first column is duplicated in other rows. In these ca

Re: [R] how to delete specific rows in a data frame where the first column matches any string from a list

2009-02-06 Thread Andrew Choens
I regularly deal with a similar pattern at work. People send me these big long .csv files and I have to run them through some pattern analysis to decide which rows I keep and which rows I kill off. As others have mentioned, Perl is a good candidate for this task. Another option would be a quick SQ

Re: [R] how to delete specific rows in a data frame where the first column matches any string from a list

2009-02-06 Thread Sebastien Bihorel
Hi Laura, You might want to read the manual on Data importation and exportation on the cran webpage http://cran.r-project.org/ Otherwise, have a look at ?read.table. Sebastien __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinf

Re: [R] how to delete specific rows in a data frame where the first column matches any string from a list

2009-02-06 Thread Laura Rodriguez Murillo
Thank you so much! I finally got it. Laura 2009/2/6 Sebastien Bihorel : > Hi Laura, > > You might want to read the manual on Data importation and exportation on the > cran webpage http://cran.r-project.org/ > Otherwise, have a look at ?read.table. > > Sebastien >

Re: [R] how to delete specific rows in a data frame where the first column matches any string from a list

2009-02-06 Thread Wacek Kusnierczyk
Andrew Choens wrote: > I regularly deal with a similar pattern at work. People send me these > big long .csv files and I have to run them through some pattern analysis > to decide which rows I keep and which rows I kill off. > > As others have mentioned, Perl is a good candidate for this task. > An

Re: [R] how to delete specific rows in a data frame where the first column matches any string from a list

2009-02-08 Thread Andrew Choens
Interesting. Thanks. On Sat, 2009-02-07 at 02:36 +0100, Wacek Kusnierczyk wrote: > Andrew Choens wrote: > > I regularly deal with a similar pattern at work. People send me these > > big long .csv files and I have to run them through some pattern analysis > > to decide which rows I keep and which r

Re: [R] how to delete specific rows in a data frame where the first column matches any string from a list

2009-02-09 Thread Wacek Kusnierczyk
Andrew Choens wrote: > Interesting. Thanks. > > On Sat, 2009-02-07 at 02:36 +0100, Wacek Kusnierczyk wrote: > >> yes, you can do this with sed. suppose you have two files, one (say, >> sample.txt) with the data to be filtered, record fields separated by, >> e.g., a tab character, and another (s