[R] gsub,regex and replacing

2010-04-28 Thread arnaud Gaboury
Dear group, I need to modify some characters in a data frame. I want to use gsub and the regex functionalities to do this. Here is the data frame (df): DESCRIPTIONprix quantity 1 CORN Jul/10-1.50 2 CORN May/10 -1082.0

Re: [R] gsub,regex and replacing

2010-04-28 Thread jim holtman
Next time you include a data frame that has spaces in the fields, please consider using 'dput' to provided the data. It is hard to read in otherwise. Will this do it: x - read.table(textConnection( DESCRIPTIONprix quantity + 1 'CORN Jul/10'-1.5

Re: [R] gsub,regex and replacing

2010-04-28 Thread arnaud Gaboury
)), .Names = c(DESCRIPTION, prix, quantity), row.names = c(NA, -6L), class = data.frame) From: jim holtman [mailto:jholt...@gmail.com] Sent: Wednesday, April 28, 2010 1:31 PM To: arnaud Gaboury Cc: r-help@r-project.org Subject: Re: [R] gsub,regex and replacing Next time you include a data frame

Re: [R] gsub,regex and replacing

2010-04-28 Thread David Winsemius
To: arnaud Gaboury Cc: r-help@r-project.org Subject: Re: [R] gsub,regex and replacing Next time you include a data frame that has spaces in the fields, please consider using 'dput' to provided the data. It is hard to read in otherwise. Will this do it: x - read.table(textConnection