I have created a character vector using paste, for example:
y <- paste("a=1,b=2,c=3")
If I try to combine it:
x <- c(y)
I get:
[1] "a=1,b=2,c=3"
I would like to get the same as if I did:
c(a=1,b=2,c=3)
which gives:
a b c
1 2 3
Sorry if this is too basic, I am new to R (and the site). Thanks!
I wonder if this is what your really want, but since you asked, here it is. This is not considered good practice, but perhaps you have a use case that would make it useful.
The answedr fron Nader hints at what appears to be a missunderstanding about constructing R character variables. The
paste
functions seems entirely superfluous for buildingy
: Just doing this is equivalent: