https://github.com/krlmlr/pkgfiles
Statistics and Tools for Files in Your R Project
https://github.com/krlmlr/pkgfiles
file-classifier r
Last synced: 4 months ago
JSON representation
Statistics and Tools for Files in Your R Project
- Host: GitHub
- URL: https://github.com/krlmlr/pkgfiles
- Owner: krlmlr
- Archived: true
- Created: 2019-05-20T14:05:20.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-20T14:25:45.000Z (almost 6 years ago)
- Last Synced: 2024-08-13T07:15:29.731Z (8 months ago)
- Topics: file-classifier, r
- Language: R
- Homepage: https://krlmlr.github.io/pkgfiles
- Size: 33.2 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
Awesome Lists containing this project
- jimsghstars - krlmlr/pkgfiles - Statistics and Tools for Files in Your R Project (R)
README
---
output:
github_document:
html_preview: false
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# pkgfiles[](https://travis-ci.org/krlmlr/pkgfiles)
[](https://ci.appveyor.com/project/krlmlr/pkgfiles)
[](https://www.tidyverse.org/lifecycle/#experimental)
[](https://cran.r-project.org/package=pkgfiles)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](https://CRAN.R-project.org) with:
``` r
install.packages("pkgfiles")
```For now, install from GitHub with
``` r
# install.packages("devtools")
devtools::install_github("krlmlr/pkgfiles")
```## Example
The `pf_get()` function enumerates and classifies all files in the current project.
```{r example}
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:
```{r}
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.
```{r}
pkgfiles:::classification
```