Getwd setwd return different directories

Hi all,

the getwd() R function does not work anymore once I work inside the RStudio Environment. I can set the the working directory to /home/user/Tmp with setwd(), and all files will be saved there. But getwd() returns the home directory /home/user.

Which system variable is getwd() accessing ?

Can you show your problem in a reprex?