12.4 base-fs-shell比较

对比base,fs,shell相同功能函数,加深记忆。直接阅读官网介绍

使用Rvest包将官网介绍的信息“爬”下来。由于是外网,想要快速正确爬虫确保网络通畅。

爬取代码如下:

library(rvest)
library(tidyverse,warn.conflicts = FALSE)


# 目录功能对比
directory_functions_dt <- read_html('https://fs.r-lib.org/articles/function-comparisons.html') %>% 
  html_nodes('#directory-functions') %>% 
  rvest::html_table() %>% `[[`(1)

# 文件功能对比
file_functions_dt <- read_html('https://fs.r-lib.org/articles/function-comparisons.html') %>% 
  html_nodes('#file-functions') %>% 
  rvest::html_table() %>% `[[`(1)

# 路径功能对比
path_functions_dt <- read_html('https://fs.r-lib.org/articles/function-comparisons.html') %>% 
  html_nodes('#path-functions') %>% 
  rvest::html_table() %>% `[[`(1)

fs-base-shell