mercredi 8 février 2017

R convert vector to string

Vote count: 0

I would like to convert a vector into a string.

This is my vector input which is a factor, as I checked by class():

c("Gross MS", "Broghammer JA", "Kaufman MR")

I am expecting a string from input vector as following:

"Gross MS Broghammer JA Kaufman MR"

I tried collapse and gsub but not much success.

Thank you for your help.

asked 46 secs ago

1 Answer

Vote count: 0

We can use paste

paste(v1, collapse= " ")

answered 18 secs ago

Let's block ads! (Why?)



R convert vector to string

Aucun commentaire:

Enregistrer un commentaire