Using '__file__' keyword

New to using python (in general) in RStudio but it seems that the __file__ keyword is not recognized by RStudio. I would normally set the working dir with something like:

dir = os.path.dirname(__file__)

But when run in the RStudio IDE this does not work. Any advice or either how to recognize __file__ or setting the working dir without __file__?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.