An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130314/6d7a665d/attachment.pl>
how to change "`Year_Month)201103`" into "Year_Month)201103" using R?
4 messages · Tammy Ma, Marc Girondot, Hasan Diwan +1 more
Le 14/03/13 09:23, Tammy Ma a ?crit :
HI, I have the pattern like "`Year_Month)201103`" I want to delete single quotes within double quetes. I want to change it into "Year_Month)201103" , how to do it in r? Thanks a lot. Tammy
> x <- "\"`Year_Month)201103`\""
> cat(x)
"`Year_Month)201103`"
> cat(gsub("`", "", x))
"Year_Month)201103"
Sincerely
Marc
__________________________________________________________ Marc Girondot, Pr Laboratoire Ecologie, Syst?matique et Evolution Equipe de Conservation des Populations et des Communaut?s CNRS, AgroParisTech et Universit? Paris-Sud 11 , UMR 8079 B?timent 362 91405 Orsay Cedex, France Tel: 33 1 (0)1.69.15.72.30 Fax: 33 1 (0)1.69.15.73.53 e-mail: marc.girondot at u-psud.fr Web: http://www.ese.u-psud.fr/epc/conservation/Marc.html Skype: girondot
On 14 March 2013 01:56, Marc Girondot <marc_grt at yahoo.fr> wrote:
cat(gsub("`", "", x))
might want to add fixed=TRUE to the gsub line.
Sent from my mobile device Envoyait de mon portable
x<- "`Year_Month)201103`"
?gsub("[`]","",x)
#[1] "Year_Month)201103"
A.K.
----- Original Message -----
From: Tammy Ma <metal_licaling at live.com>
To: "r-help at r-project.org" <r-help at r-project.org>
Cc:
Sent: Thursday, March 14, 2013 4:23 AM
Subject: [R] how to change "`Year_Month)201103`" into "Year_Month)201103" using R?
HI,
I have the pattern like "`Year_Month)201103`"? I want to delete single quotes within double quetes.
I want to change it into "Year_Month)201103" , how to do it in r?
Thanks a lot.
Tammy
??? ??? ??? ? ??? ??? ?
??? [[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.