Skip to content
Prev 361227 / 398506 Next

How to replace all commas with semicolon in a string

C1        C2 
"a;b;c;d"   "g;h;f" 

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jun Shen
Sent: Friday, May 27, 2016 10:21 AM
To: Ulrik Stervbo
Cc: R-help
Subject: Re: [R] How to replace all commas with semicolon in a string

Thanks Ulrik and Bob for your reply.

gsub worked for one column!

If I want to replace the whole data frame, gsub doesn't seem to work. Any
idea

On Fri, May 27, 2016 at 11:14 AM, Ulrik Stervbo <ulrik.stervbo at gmail.com>
wrote:
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.