README.md

fml

Build
status CRAN
status Coverage
Status

Downloads Downloads lifecycle

File Management and Location tools

Installation

Install the development version from Github with:

## install remotes pkg if not already
if (!requireNamespace("remotes", quietly = TRUE)) {
  install.packages("remotes")
}

## install from github
remotes::install_github("mkearney/fml")

Find or search for files

## find the rtweet readme
find_file("rtweet", "README.Rmd")
#> [1] "/Users/mwk/R/rtweet/README.Rmd"
## starts with capital letter and doesn't end with md/html
search_file("[A-Z]*[!md|html]")
#> [1] "/Users/mwk/R/fml/DESCRIPTION" "/Users/mwk/R/fml/LICENSE"    
#> [3] "/Users/mwk/R/fml/NAMESPACE"   "/Users/mwk/R/fml/docs/CNAME"

## all .yml files not in docs/
search_file("[!docs]*.yml")
#> [1] "/Users/mwk/R/fml/_pkgdown.yml"     "/Users/mwk/R/fml/docs/pkgdown.yml"

## .yml files that start with a dot
search_file(".*.yml")
#> [1] "/Users/mwk/R/fml/.travis.yml"

Files in projects

## locate file in project
here("R", "fp.R")
#> [1] "/Users/mwk/R/fml/R/fp.R"

List files/directories

## list files in directory
list_files(full = FALSE)
#> [1] "_pkgdown.yml" "codecov.yml"  "DESCRIPTION"  "fml.Rproj"   
#> [5] "LICENSE"      "LICENSE.md"   "NAMESPACE"    "README.md"   
#> [9] "README.Rmd"
## list dirs in directory
list_dirs(full = FALSE)
#> [1] "docs"    "man"     "pkgdown" "R"       "tests"
## list files AND paths in directory
list_paths(full = FALSE)
#>  [1] "_pkgdown.yml" "codecov.yml"  "DESCRIPTION"  "docs"        
#>  [5] "fml.Rproj"    "LICENSE"      "LICENSE.md"   "man"         
#>  [9] "NAMESPACE"    "pkgdown"      "R"            "README.md"   
#> [13] "README.Rmd"   "tests"

Misc

## build this/that
fp("this", "that")
#> [1] "this/that"

## pipe style
"this" %FP% "that"
#> [1] "this/that"
## build this/that
pe(fp(".", "this", "that"))
#> [1] "./this/that"

## pipe style
pe("~" %FP% "this" %FP% "that")
#> [1] "/Users/mwk/this/that"


mkearney/fml documentation built on May 9, 2019, 10:43 a.m.