Re: [R] gsub,regex and replacing

2010-04-28 Thread David Winsemius
ast on my client) posting. -- David. 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 that has spaces in the fields, please consider

Re: [R] gsub,regex and replacing

2010-04-28 Thread arnaud Gaboury
, -1082, 11084, 1983.5, -2464, -118), quantity = c(0, -3, 8, 2, -1, 0)), .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

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

[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