R basename() Function
The basename() is a base R function that extracts the last component (or the ‘base name’) of a file or directory path and returns the name of the file or directory. So, if you have a path like “/Users/krunallathiya/Desktop/Code/pypro/data.pdf,“ basename() would return “data.pdf.“ The opposite function of basename() is dirname(), which gives the directory part of the path. Syntax basename(path) … Read more