find the name of a csv file in r

To find the name of a csv file in R, you can use the basename() function in conjunction with the read.csv() function.

Here's an example code:

main.r
# Set file path 
file.path <- "path/to/your/csv/file.csv"

# Read csv file 
data <- read.csv(file.path)

# Get file name 
file.name <- basename(file.path)

# Print file name 
print(file.name)
192 chars
12 lines

This will print the file name of your csv file to the console.

gistlibby LogSnag