These are wrappers around setwd and getwd.

cd(), when called without any arguments, sets the working directory to the directory of the source file.

cd(dir, focus = getOption("utilscognigen.cd_focus", TRUE))

pwd()

Arguments

dir

A character string: tilde expansion will be done.

focus

logical indicating whether to show the working directory in the RStudio Files pane.