We can convert using paste() and use collapse argument to separate vectors items
Code to convert vectors to strings
#Converting Vectors to Strings
stringVector <- c(“Introduction”, “to”, “R”)paste(stringVector, collapse = ” “)paste(stringVector, collapse = “.”)intVector <- c(1, 2, 3)paste(intVector, collapse = “,”)
Output
[1] “Introduction to R”
[1] “Introduction.to.R”
[1] “1,2,3”
Like this:
Like Loading...
Related