Jame H
Jame H

Reputation: 1384

Generate path string of subfolder in the working directory for R

In R, I want to load a file in a subfolder in working directory. But For convinent, I want to generate path of this folder to combine with file which i want to access. I don't know how to do it.

Please help me.

Thank a lot.

Upvotes: 3

Views: 1381

Answers (1)

jdharrison
jdharrison

Reputation: 30425

Use file.path

> file.path(getwd(), "yourpath")
[1] "C:/Users/john/Documents/yourpath"

Upvotes: 1

Related Questions