Reputation: 23898
I want to replace quotes with blank spaces and want to add comma.
test <- c("A", "B")
test
[1] "A" "B"
gsub(pattern=""", replacement=" " , x=test)
Desired Output
A, B
Upvotes: 0
Views: 1252
Reputation: 193527
You may want to consider one of the following, but which is better would depend on what you are actually trying to achieve:
cat(test, sep = ", ")
# A, B
noquote(paste(test, collapse = ", "))
# [1] A, B
Upvotes: 2