(1) The backslashes are not really there; they are an artefact of the R print() function.
Try cat(u,"\n").  I think this might be an FAQ.

(2) Is not your problem the fact that your are setting "replacement" equal to the
thing you are trying to get rid of?  I.e. don't you want

    v <- gsub(pattern='\"',replacement='',x=u)     ???

Either I am misunderstanding your intent or you need another cup of coffee.

    cheers,

    Rolf

On 11/18/13 11:07, Erin Hodgess wrote:
Dear R People:

I'm sure that this is a very simple problem, but I have been wresting with
it for some time.

I have the following file that has the following one line:

  CRS("+init=epsg:28992")

Fair enough.  I scan it into R and get the following:

u
[1] "CRS(\"+init=epsg:28992\")"
gsub(pattern='\"',replacement='"',x=u)
[1] "CRS(\"+init=epsg:28992\")"

I need to get rid of the extra quotation marks and slashes.  I've tried all
sorts of things, including gsub, as you see,  but no good.

______________________________________________
R-help@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.

Reply via email to