[R] line breaks in recode

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Nov 4 12:51:54 CET 2003


Nothing to do with recode: you cannot have line breaks inside quoted 
strings.

> "c(101,25,167,45,75)=25;
Error: syntax error
>              c(104,51)=51"
Error: syntax error


On Tue, 4 Nov 2003, Bernd Weiss wrote:

> Dear all,
> 
> it seems to be that 'recode' can't handle any line breaks in its code.
> 
> The following command causes no problem:
> 
> datameta$smpid.r <- 
> recode(datameta$smpid,"c(101,25,167,45,75)=25;c(104,51)=51")
> 
> But if I type ...
> 
> datameta$smpid.r <-recode(datameta$smpid,
> 	"c(101,25,167,45,75)=25;
>              c(104,51)=51")
> 
> ... the result is a syntax error. 
> 
> TIA
> 
> Bernd
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list