data.frame 或 tibble 中的 fs_path 行为不符合预期

问题描述 投票:0回答:1

我正在尝试自动检测目录中最后修改的文件。然而,从

file_info
包调用
fs
所产生的小标题与我正在使用的一些 dplyr 函数不能很好地配合。有人有意见吗?

谢谢!

library(tidyverse)
write.csv(data.frame(test = 1),"test.csv")
write.csv(data.frame(test = 1),"test2.csv")

date <- list.files(".", pattern = "test", full.names = T) |> 
  fs::file_info() |> 
  ungroup() |> 
  as_tibble() |> 
  pluck(path)

## does not return a character vector of length 2 as I would expect
r dplyr tidyverse node.js-fs
1个回答
0
投票

我的错。我应该用过

dplyr::pull

不是

purrr:pluck

© www.soinside.com 2019 - 2024. All rights reserved.