Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

programmatically print name of Rproject I am working in

Tags:

r

I can programmatically extract and save the name of my project by assuming that the project name is the last string after "/" in the file path generated by here::here().

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

Is there a safer way to access the project name programmatically? Something like project.name(), which is a make-believe function?

like image 373
Joe Avatar asked Nov 06 '22 17:11

Joe


1 Answers

I think you are looking for rstudioapi::getActiveProject().

like image 192
hplieninger Avatar answered Nov 15 '22 12:11

hplieninger