Vladislav Ladenkov Vladislav Ladenkov - 1 month ago 5
R Question

Collapse a matrix of "chars" to string

I' ve got

chr [1:4, 1:4, 1:2, 1:3]
, filled with string like "bla1", "bla2", etc.
I want to make a single vector of all these 96 elements with NO quotation marks: bla1 bla2, so, if i type:
final_vector[2]
, i'd have an output:
bla2
.
P.S. I would preferebly like a non-regexp solution.
Thanks!

Answer

To produce strings without quotations do

noquote(chr)

Comments