在rstudio中查看r script位置 查看文件位置rstudioapi::getSourceEditorContext()$path 查看上层目录位置dirname(rstudioapi::getSourceEditorContext()$path)