Create vector from file names in folder?

Just to make sure, are you familiar with relative file paths? If not, this image from Automate the Boring Stuff with Python by Al Sweigart gives some good examples.

In R, you can find out what your current working directory is with the getwd() function. Also, make sure to use / (forward slash) instead of \ (backslash) for separating directories in a path (so, don't write them like in the image). Backslash has a special meaning in R strings, and / works just fine for Windows paths.

2 Likes