代码之家  ›  专栏  ›  技术社区  ›  Joe

以编程方式打印我正在工作的项目的名称

r
  •  1
  • Joe  · 技术社区  · 5 年前

    假设项目名是here::here()生成的文件路径中“/”之后的最后一个字符串,我可以通过编程方式提取并保存项目的名称。

      here::here() %>% stringr::str_extract("[^/]*$")
    

    project.name()

    0 回复  |  直到 5 年前
        1
  •  1
  •   hplieninger    5 年前

    我想你在找 rstudioapi::getActiveProject()