talira

Cross-platform file system operations for R, built on libuv

open sourceMITfree

fs is an R package that gives a cross-platform, uniform interface to file system operations, built on top of the libuv C library that Node.js uses. Its functions are grouped by prefix (path_ for building and changing paths, file_, dir_ and link_ for files, directories and links), are all vectorised, always return paths as UTF-8, throw an error when an operation fails instead of a warning, and return tidy paths that always use /, coloured by file type and permissions.

Problems it solves

  • list, copy and delete files in R the same way on Windows and Linux
  • my R script's file.copy fails silently and I miss it
  • build file paths in R that work on every OS

Features

  • path_, file_, dir_ and link_ functions with one naming convention
  • every function vectorised over paths
  • UTF-8 paths on every operating system
  • errors instead of warnings when an operation fails
  • tidy paths, coloured by file type through LS_COLORS

Alternatives

The same job

These do what fs does.

  1. here Build file paths relative to your R project's root

Compare fs with the top 3