R 如何从数据框中整理数据(维基百科内部链接)?
我正在使用WikipediR包处理wikipedia的内部链接 我正在寻找有关Hérodote的内部链接(法语) 如何整理我的R 如何从数据框中整理数据(维基百科内部链接)?,r,wikipedia,R,Wikipedia,我正在使用WikipediR包处理wikipedia的内部链接 我正在寻找有关Hérodote的内部链接(法语) 如何整理我的数据.frame对象 预期结果: pageid title 60 Attributs du pharaon 133 Apis 152 Antropologie 159 Asie 您正在使用的函数返回列表中的命名字符向量。我们可以将purrr::map_df()与as.list()一起使用map_df()将
数据.frame
对象
预期结果:
pageid title
60 Attributs du pharaon
133 Apis
152 Antropologie
159 Asie
您正在使用的函数返回列表中的命名字符向量。我们可以将
purrr::map_df()
与as.list()
一起使用map_df()
将对all_bls
列表中的每个元素执行as.list()
,并自动将它们绑定到数据框中:
purrr::map_df(all_bls, as.list)
## # A tibble: 50 × 3
## pageid ns title
## <chr> <chr> <chr>
## 1 60 0 Attributs du pharaon
## 2 133 0 Apis
## 3 152 0 Anthropologie
## 4 159 0 Asie
## 5 325 0 Ahmôsis II
## 6 412 0 Bastet
## 7 542 0 Corse
## 8 715 0 Cyclades
## 9 734 0 Culte à mystères
## 10 821 0 Chamanisme
## # ... with 40 more rows
purrr::map\u df(所有bls,as.list)
###A tible:50×3
##页面ID ns标题
##
##1600人属于法老王
##21330 API
##31520人类学
##41590亚洲
##5325艾哈迈迪斯二世
##巴斯特64120
##7 542 0科塞
##87150辆自行车
##9734对我的崇拜
##108210chamanime
## # ... 还有40行
pageid title
60 Attributs du pharaon
133 Apis
152 Antropologie
159 Asie
purrr::map_df(all_bls, as.list)
## # A tibble: 50 × 3
## pageid ns title
## <chr> <chr> <chr>
## 1 60 0 Attributs du pharaon
## 2 133 0 Apis
## 3 152 0 Anthropologie
## 4 159 0 Asie
## 5 325 0 Ahmôsis II
## 6 412 0 Bastet
## 7 542 0 Corse
## 8 715 0 Cyclades
## 9 734 0 Culte à mystères
## 10 821 0 Chamanisme
## # ... with 40 more rows