I have a vector: c(1,2,3)
Calling print()
on this value gives [1] 1 2 3
Is there a function that takes a vector and gives the string c(1,2,3)
?
You can use deparse
:
R> x <- c(1, 2, 3)
R> deparse(x)
[1] "c(1, 2, 3)"
R> class(deparse(x))
[1] "character"
using dput
:
a <- c(1, 2, 3);
dput(a)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With