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
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
)), .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
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
4 matches
Mail list logo