knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

pkgfiles

Travis build status AppVeyor build status Lifecycle: experimental CRAN status

The goal of pkgfiles is to enumerate and classify all files in an R package project. This is mostly useful for other packages that iterate over all files of a specific kind in an R package.

Installation

Once released, you can install the released version of pkgfiles from CRAN with:

install.packages("pkgfiles")

For now, install from GitHub with

# install.packages("devtools")
devtools::install_github("krlmlr/pkgfiles")

Example

The pf_get() function enumerates and classifies all files in the current project.

library(pkgfiles)
pf_get()

Under the hood, the returned object is a tibble that contains the return from a fs::dir_info() call augmented by a class column:

tibble::as_tibble(pf_get())

The classification is based on regular expressions for the project-relative path of the files. This list is extensible but the existing entries should rarely change.

pkgfiles:::classification


krlmlr/pkgfiles documentation built on May 21, 2019, 12:34 a.m.