This works for me:
getSrcDirectory(function(x) {x})
This defines an anonymous function (that does nothing) inside the script, and then determines the source directory of that function, which is the directory where the script is.
More Related Contents:
- Determine path of the executing script
- Escaping backslash (\) in string or paths in R
- Automatically Delete Files/Folders
- Folder management with r : Check existence of directory and create it if it doesn’t exist
- Function to concatenate paths?
- Filter data.frame rows by a logical condition
- How to prevent ifelse() from turning Date objects into numeric objects
- Evaluate expression given as a string
- Split column at delimiter in data frame [duplicate]
- Cluster analysis in R: determine the optimal number of clusters
- Select groups based on number of unique / distinct values
- How to send an email with attachment from R in windows
- How to create example data set from private data (replacing variable names and levels with uninformative place holders)?
- The condition has length > 1 and only the first element will be used
- Does R have quote-like operators like Perl’s qw()?
- Simplest way to get rbind to ignore column names
- Force character vector encoding from “unknown” to “UTF-8” in R
- ggplot2: facet_wrap strip color based on variable in data set
- Difference between passing options in aes() and outside of it in ggplot2
- Sum all values in every column of a data.frame in R
- How to extract the fill colours from a ggplot object?
- Create categorical variable in R based on range
- Apply several summary functions (sum, mean, etc.) on several variables by group in one call
- Order of operator precedence when using “:” (the colon)
- Using dynamic column names in `data.table`
- Determining UTM zone (to convert) from longitude/latitude
- Spreading a two column data frame with tidyr
- Using R to download zipped data file, extract, and import .csv
- Downloading png from Shiny (R)
- Layered axes in ggplot?