[R] Odp: How to read percentage and currency data?

Gabor Grothendieck ggrothendieck at gmail.com
Thu Feb 25 00:10:54 CET 2010


On Wed, Feb 24, 2010 at 11:28 AM, Petr PIKAL <petr.pikal at precheza.cz> wrote:
> Hi
>
> r-help-bounces at r-project.org napsal dne 24.02.2010 16:55:49:
>
>>
>> Petr,
>>
>> Removing the % signs by Ista's method works. However as I noted earlier,
> I
>> was hoping there was a more elegant solution which deals with percentage
> and
>> currency values without knowing about their presence beforehand.
>>
>> It's a shame that something which Excel deals with trivially is such a
> hack
>> in R. I'll try to delve deeper and write something which does this well.
> But
>> my knowledge is limited and I will probably come back for help.
>
> I believe that if you introduce a new class which could specify currencies
> you could write methods for handling them. But it is beyond my knowledge
> and somebody else has to answer it.
>

Try adapting this example of using a custom class with read.table:

  https://www.stat.math.ethz.ch/pipermail/r-help/2007-April/130912.html

or this example of piping through tr to read.table:

  http://tolstoy.newcastle.edu.au/R/e9/help/10/02/4324.html



More information about the R-help mailing list