Skip to content
Back to formatted view

Raw Message

Message-ID: <433D26DE.5060203@statistik.uni-dortmund.de>
Date: 2005-09-30T11:51:58Z
From: Uwe Ligges
Subject: bug in gsub with perl=TRUE (PR#8164)
In-Reply-To: <20050930093335.B84DA1C915@slim.kubism.ku.dk>

Richard.Mott at well.ox.ac.uk wrote:

> Full_Name: Richard Mott
> Version: 2.0.1

This version is completely outdated.
Please try with a *recent* version of R when reporting bugs, in this 
case R-2.2.0 beta (or in worst case R-2.1.1, the current release).

The bug reported below has been fixed some months ago ...

Uwe Ligges

> OS: Linux toad 2.6.9 #4 SMP Mon Feb 21 16:20:16 GMT 2005 x86_64 AMD Opteron(tm) Processor 848 AuthenticAMD GNU/Linux
> Submission from: (NULL) (129.67.46.247)
> 
> 
> gsub with perl=TRUE does not work properly. It pads/truncates the resulting
> string to
> the length of the input string: 
> 
> my.formula <- "log10(Biochem.ALP)^2+1 ~ Family + GENDER"
> 
> 
>>gsub("^.+~", "transformed.y ~", my.formula )
> 
> [1] "transformed.y ~ Family + GENDER"
> 
> 
>>gsub("^.+~", "transformed.y ~", my.formula, perl=TRUE )
> 
> [1] "transformed.y ~ Family + GENDER\0\006\0\0\r\377\0\0\0"  # padded
> 
>  my.formula <- "Biochem.ALP ~ Family + GENDER"
> 
>>gsub("^.+~", "transformed.y ~", my.formula, perl=TRUE )
> 
> [1] "transformed.y ~ Family + GEND"  # truncated
> 
>>gsub("^.+~", "transformed.y ~", my.formula )
> 
> [1] "transformed.y ~ Family + GENDER"
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel