[R] pushBack

kjetil@entelnet.bo kjetil at entelnet.bo
Wed Dec 3 04:53:53 CET 2003


Hola!

I have been fighting some with pushBack, well, at latest I gor it to 
do what I want, but the documentation could be clearer. 

>From the documentation:

data a character vector.

but the simple use pushes back each element of the character vector, 
so that pushing back a character vector of length 5 gives 5 lines in 
the pushback stack. Neither does the argument newLine=FALSE help, it 
pastes all together as if used with paste( , collapse="").

If I have read a character vector with 
test <- scan( myfile, what=character(0), nlines=1 )

to push it back as it was needs

pushBack( paste(test, collapse=" "), myfile )

could this be mentioned in the documentation , for example added to 
the examples part?

Kjetil Halvorsen




More information about the R-help mailing list