Quantcast

object type changes after being used as an argument in .Internal(paste(...))

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

object type changes after being used as an argument in .Internal(paste(...))

Joris FA Meys
OK, I realize I'm hacking away in R in a manner that was not intended,
but I found this interesting behaviour nonetheless, and I am not sure
whether this was intended to be so or not.

> x <- list(1:3,1:3,1:3)
> r1 <- do.call(paste,x) # the correct way
> sapply(x,typeof)
[1] "integer" "integer" "integer"

> r2 <- .Internal(paste(x,sep=" ",collapse=NULL))
> sapply(x,typeof)
[1] "character" "character" "character"

So although I don't change x explicitly, after the call to
.Internal(paste(...)) it suddenly is a list of characters instead of
integers. Is this supposed to happen? (Normally .Internal(paste(...))
takes an anonymous list(...) as argument, so it might very well be the
intended way of working.)

Cheers
Joris
--
Joris Meys
Statistical consultant

Ghent University
Faculty of Bioscience Engineering
Department of Mathematical Modelling, Statistics and Bio-Informatics

tel : +32 9 264 59 87
[hidden email]
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Loading...