R getwd()

KyraThompson's avatar
Published Oct 7, 2022
Contribute to Docs

The getwd() function returns the current working directory as an absolute file path. Otherwise, it returns NULL if a directory is not found.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn how to code and clean and manipulate data for analysis and visualization with the R programming language.
    • Beginner Friendly.
      14 hours

Syntax

getwd()

The getwd() function takes no parameters.

Example

The following example showcases the getwd() function:

> getwd()
[1] "/Users/kyra/Documents"

All contributors

Contribute to Docs

Learn R on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn how to code and clean and manipulate data for analysis and visualization with the R programming language.
    • Beginner Friendly.
      14 hours