Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从r中的列中删除数字_R - Fatal编程技术网

从r中的列中删除数字

从r中的列中删除数字,r,R,我用下面的代码做了一些网页抓取,现在我想删除字符串开头的数字。该列如下所示: 1. Huddle 2. Shortlist Media 3. Three Sixty Entertainment 4. Naked Wines 代码如下: tab10%html\u节点(“h2”)%%>%html\u文本()%%>%data.frame()%%>%map\u df(rev) 有人能帮忙吗?谢谢 请尝试stringr::stru rem

我用下面的代码做了一些网页抓取,现在我想删除字符串开头的数字。该列如下所示:

1. Huddle           
2. Shortlist Media          
3. Three Sixty Entertainment            
4. Naked Wines
代码如下:

tab10%html\u节点(“h2”)%%>%html\u文本()%%>%data.frame()%%>%map\u df(rev)

有人能帮忙吗?谢谢

请尝试
stringr::stru remove(c(“1.A”、“2.B”)、“^\\d+\\\.\\s”)
,删除由数字后跟一个点和字符串开头的空格组成的任何字符串。如果数据集名为
df
,且列为第1列,则可以使用基函数
sub(“^\\d+\\.\\s+”,“”,df[[1]])