Learn R Programming

pathological

R package of utilities for handling paths, files and directories

Installation

To install, you first need the devtools package.

install.packages("devtools")

Then you can install the pathological package using

library(devtools)
install_github("richierocks/pathological")

Decomposing paths

decompose_path splits a path into a directory name, file name (without extension), and a file extension. recompose_path reverses the effects of this function.

get_extension, strip_extension, and replace_extension allow manipulation of file extensions. They are smart enough to deal with double extensions like tar.gz.

On Windows, get_drive returns the drive name of the path.

Copying directories

copy_dir copies the contents of a directory.

Standardizing paths

standardize_path (and standardise_path, for British English fans) is a wrapper to base::normalizePath that standardizes the form of a path, to make them more easily comparable. You can choose whether you want back or forward slashes, and the inputs paths are given as names.

r_home, temp_dir, temp_file, system_file, and sys_which provide standardized versions of the similarly named base R functions.

Other utilities

os_path returns the operating system PATH environment variable as a character vector of stanardized paths.

On Windows, cygwinify_path makes paths suitable for use with cygwin.

Copy Link

Version

Install

install.packages('pathological')

Monthly Downloads

108

Version

0.1-1

License

Unlimited

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

September 5th, 2016

Functions in pathological (0.1-1)

get_libraries

Get the libraries on your machine
os_path

The OS path
parent_dir

Get the parent dir
cygwinify_path

Make a path suitable for cygwin
decompose_path

Split a path into its components
create_dirs

Create or remove files and directories
is_windows_drive

Is the path a Windows drive?
copy_dir

Copy the contents of a directory
get_windows_drive

On Windows, return the drive of the path
temp_dir

Return paths to files or dirs within the temp dir
split_path

Split a path into directory components
r_environ

Get the location of the R profile/environ
standardize_path

Standardize paths
pathological

pathological: utilities for paths, files and directories.
r_home

The R home directory
rstudio_project_dir

Get the RStudio project directory
sys_which

Find paths to executables
system_file

Find a file in a package
choose_dir

Choose files interactively