1

I have a vector:

vec = c("2019-01-01", "2019-02-02", "2019-03-03")

I am looking to create a string for an API call that takes the vector, removes the spaces and adds a % between each character

vec = "2019-01-01%2019-02-02%2019-03-03"

How do i create a vector that automatically inserts the "%" and removes the spaces?

I have tried the following without success. Thank you

paste0(vec, sep = "%") 
Jordan Wrong
  • 1,205
  • 1
  • 12
  • 32

0 Answers0