[R] Fortune? [was: Re: quotation marks and scan]

Achim Zeileis Achim.Zeileis at uibk.ac.at
Mon Nov 18 08:41:49 CET 2013


On Sun, 17 Nov 2013, Ted Harding wrote:

> [See in-line below]
> On 17-Nov-2013 22:38:30 Rolf Turner wrote:
>>
>> (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.
>
> Is the above line a Fortune?

Why not? ;-) On R-Forge now.
Z

>
>>      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 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.
>
> -------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding at wlandres.net>
> Date: 17-Nov-2013  Time: 23:55:48
> This message was sent by XFMail
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list