I've picked up some old code off someone (cannot ask them directly) and they have the following code
setwd(dirname(getActiveDocumentContext()$path))
dataset= fread("../Folder/excel_file.csv", stringsAsFactors = FALSE)
I am wondering how fread
knows what the ".."
is? I assume the directory has been set in the first line, however I don't know how to interpret it as I need to change the directory that it currently reads from.
When I run getwd() it shows me a file path that doesnt even have excel_file.csv but when I run that line it successfully imports the dataset so I am entirely confused. Any assistance would be greatly appreciated thank you