如何转换“空间”到“%20”与R [英] How to Convert "space" into "%20" with R

查看:135
本文介绍了如何转换“空间”到“%20”与R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参考标题,我想知道如何将单词之间的空格转换为%20。



例如,

 > y<  - I Love You

如何使 y = I %20Love%20You

 > y 
[1]I%20Love%20You

p>

解决方案

gsub()是一个选项:

  R> gsub(pattern =,replacement =%20,x = y)
[1]I%20Love%20You

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.

解决方案

gsub() is one option:

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

这篇关于如何转换“空间”到“%20”与R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆