Classwork 4

Finding and Copying an Absolute Pathname

Find a downloaded file in Windows or macOS, copy its absolute pathname, and paste it into a text editor.
Author

Byeong-Hak Choe

Published

September 29, 2026

If you use RStudio on your local computer, you need to know how to find and copy a file’s absolute pathname. The pathname tells R exactly where the file is stored.

An absolute pathname lists every folder from the top of the computer’s file system to the file itself.

Copy an absolute pathname

Windows

  1. Open File Explorer and find the file.
  2. Right-click the file and choose Copy as path.
    • If that command is hidden, hold Shift while right-clicking.
  3. Paste the copied pathname where you need it.

Example copied pathname

"C:\Users\Alex\Downloads\custdata_rev.csv"

Mac

  1. Open Finder and find the file.
  2. Select the file and press Option + Command + C.
    • Or hold Option, right-click, and choose Copy “custdata_rev.csv” as Pathname.
  3. Paste the copied pathname where you need it.

Example copied pathname

/Users/Alex/Downloads/custdata_rev.csv
Note

When entering a Windows pathname in R, use forward slashes (/) or double each backslash (\\).

Mini exercise

TipGoal

Retrieve a downloaded file’s exact location instead of typing it by hand.

  1. Download custdata_rev.csv from Brightspace.
  2. Find the downloaded file in File Explorer (Windows) or Finder (Mac).
  3. Copy its absolute pathname using the method above.
  4. Paste the pathname into any text editor, such as Notepad, TextEdit, or an RStudio script.
  5. Check that the pasted pathname ends with custdata_rev.csv.

Your pasted text should resemble:

  • Windows: C:\Users\...\Downloads\custdata_rev.csv
  • Mac: /Users/.../Downloads/custdata_rev.csv
Back to top