Skip to content
Prev 171217 / 398506 Next

How to transfer a list of space delimited character elements into a char vector?

Hi,

something like this perhaps,


create_string <- function(.s){
	result <- read.table(textConnection(.s))
	sapply(result, as.character)
}

(test <- create_string("ab cd ef"))

hope this helps

baptiste
On 20 Feb 2009, at 16:38, Sean Zhang wrote:

            
_____________________________

Baptiste Augui?

School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK

Phone: +44 1392 264187

http://newton.ex.ac.uk/research/emag