Getting Started

Matthew Strasiotto

2019-02-14

This document aims to provide an overview of the basic usage of the Path object. Before we start, we load the package.

library(pathlibr)
library(glue)

Motivation

The Path class aims to make navigating directories a little more convenient, it provides convenient interfaces for common operations such as navigating up (To the parent directory), listing child directories, and joining paths.

Getting Started

Making a Path

First lets initialize a new path object.

root <- Path$new(system.file("", package = "pathlibr", mustWork = TRUE))

And lets view the new path

root$show
#> [1] "/private/var/folders/xl/014m21yx3x52_b9hcr7sztz80000gs/T/Rtmp9gT9Yx/Rinst813f1c8bc5fa/pathlibr/"

So far so good, we were able to initialize a Path object at our package install root.

Now how do we use it?