On Mon, Aug 24, 2009 at 5:36 PM, Peter Dalgaard wrote:
>
> The documentation has:
>
> >>
> The internal equivalent of the default method of as.character is performed
> on x (so there is no method dispatch). If you want to operate on non-vector
> objects passing them through deparse first will be r
Stavros Macrakis wrote:
In R 2.9.1 Windows:
nchar(factor(paste('sdf',1:10)))
[1] 1 1 1 1 1 1 1 1 2 1
so it appears that nchar is counting the number of characters in the numeric
representation, just like:
nchar(as.numeric(factor(paste('sdf',1:10
[1] 1 1 1 1 1 1 1 1 2 1
but ?nchar sa
In R 2.9.1 Windows:
> nchar(factor(paste('sdf',1:10)))
[1] 1 1 1 1 1 1 1 1 2 1
so it appears that nchar is counting the number of characters in the numeric
representation, just like:
> nchar(as.numeric(factor(paste('sdf',1:10
[1] 1 1 1 1 1 1 1 1 2 1
but ?nchar says explicitly:
x: ch