Q:

How to Convert "space" into "%20" with R

Referring the title, I'm figuring how to convert space between words to be %20 .
For example, 
> y <- "I Love You"

How to make y = I%20Love%20You
> y
[1] "I%20Love%20You"

Thanks a lot.

A:

Another option would be URLencode():
y <- "I love you"
URLencode(y)
[1] "I%20love%20you"

A:

gsub() is one option:
R> gsub(pattern = " ", replacement = "%20", x = y)
[1] "I%20Love%20You"

