Classwork 5
Finding and Copying an Absolute Pathname
Please complete the question in this Classwork, and submit your response in the corresponding Brightspace page.
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
- Open File Explorer and find the file.
- Right-click the file and choose Copy as path.
- If that command is hidden, hold Shift while right-clicking.
- Paste the copied pathname where you need it.
Example copied pathname
C:\Users\bchoe\Downloads\custdata_rev.csv
Mac
- Open Finder and find the file.
- Select the file and press Option + Command + C.
- Or hold Option, right-click, and choose Copy “custdata_rev.csv” as Pathname.
- Paste the copied pathname where you need it.
Example copied pathname
/Users/bchoe/Downloads/custdata_rev.csv
When entering a Windows pathname in R, use forward slashes (/) or double each backslash (\\).
Mini exercise
Retrieve a downloaded file’s exact location instead of typing it by hand.
- Download
custdata_rev.csvfrom Brightspace. - Find the downloaded file in File Explorer (Windows) or Finder (Mac).
- Copy its absolute pathname using the method above.
- Paste the pathname into any text editor, such as Notepad, TextEdit, or Microsoft Word.
- 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
