12.4 base-fs-shell比较
对比base,fs,shell相同功能函数,加深记忆。直接阅读官网介绍
使用Rvest包将官网介绍的信息“爬”下来。由于是外网,想要快速正确爬虫确保网络通畅。
爬取代码如下:
library(rvest)
library(tidyverse,warn.conflicts = FALSE)
# 目录功能对比
<- read_html('https://fs.r-lib.org/articles/function-comparisons.html') %>%
directory_functions_dt html_nodes('#directory-functions') %>%
::html_table() %>% `[[`(1)
rvest
# 文件功能对比
<- read_html('https://fs.r-lib.org/articles/function-comparisons.html') %>%
file_functions_dt html_nodes('#file-functions') %>%
::html_table() %>% `[[`(1)
rvest
# 路径功能对比
<- read_html('https://fs.r-lib.org/articles/function-comparisons.html') %>%
path_functions_dt html_nodes('#path-functions') %>%
::html_table() %>% `[[`(1) rvest