This is the same question as here, except I needed to do that in R.
Locating the google drive folder on the computer is useful when you need to access a file within the google drive folder, but this google driver folder has different paths on your different computers, which makes the sharing of script difficult.
I have not found solutions on how to do that in R, so I thought it might be useful, for anyone else having the same question, to open a thread here. I have prepared a solution for R based on the link above.
I would be glad to read a better/simpler solution than the one I will present here.
In addition, my solution will likely only work for Windows users, so a solution for other OS or a more general cross-OS solution would be welcome.