Skip to content

Commit

Permalink
Address R CMD check.
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolepore committed Jan 3, 2019
1 parent 4cd2e74 commit 7fa5954
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 139 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# tor 1.0.0
# tor 0.0.0.9000 unreleased

* Initial release.
4 changes: 2 additions & 2 deletions R/format_path.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#' @param base,prefix,files,ext Character vectors (all of length-1 except
#' `files`, which can be of any length.
#'
#' @return A string of the same length as `files`. For example:
#' `base/prefix-file1.csv` and `base/prefix-file2.csv`.
#' @return A string of the same length as `files`.
#'
#' @export
#'
#' @examples
Expand Down
2 changes: 2 additions & 0 deletions R/imports.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#' @importFrom rlang %||% abort set_names
NULL
1 change: 0 additions & 1 deletion R/list_any.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#' "[.]Rdata$",
#' ignore.case = TRUE
#' )
#' @importFrom rlang %||% abort set_names
list_any <- function(path = ".",
.f,
regexp = NULL,
Expand Down
13 changes: 5 additions & 8 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,13 @@ imap_chr(dfms, ~ format_path(.y, "csv"))
# Same
map_chr(dfms, ~ format_path(names(.), "csv", ".", "this-"))
```
This is how to use it in a pipeline:
(dfs <- list_csv())
```{r}
list_csv() %>%
walk2(
imap_chr(dfms, ~ format_path(.y, "csv", base = ".", prefix = "this-")),
write.csv
)
paths <- dfs %>%
imap_chr(~ format_path(.y, "csv", base = ".", prefix = "this-"))
walk2(dfs, paths, readr::write_csv)
dir_ls(".", regexp = "this-")
```
Expand Down
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ devtools::install_github("maurolepore/tor")

``` r
library(tidyverse)
#> -- Attaching packages --------------------------------------------- tidyverse 1.2.1 --
#> -- Attaching packages ------------------------------------------------------------ tidyverse 1.2.1 --
#> v ggplot2 3.1.0 v purrr 0.2.5
#> v tibble 1.4.2 v dplyr 0.7.8
#> v tidyr 0.8.2 v stringr 1.3.1
#> v readr 1.3.1 v forcats 0.3.0
#> -- Conflicts ------------------------------------------------ tidyverse_conflicts() --
#> -- Conflicts --------------------------------------------------------------- tidyverse_conflicts() --
#> x dplyr::filter() masks stats::filter()
#> x dplyr::lag() masks stats::lag()
library(fs)
Expand Down Expand Up @@ -321,16 +321,22 @@ imap_chr(dfms, ~ format_path(.y, "csv"))
map_chr(dfms, ~ format_path(names(.), "csv", ".", "this-"))
#> csv1 csv2
#> "./this-x.csv" "./this-y.csv"
```

This is how to use it in a pipeline:
(dfs <- list_csv())
#> $csv1
#> x
#> 1 1
#> 2 2
#>
#> $csv2
#> y
#> 1 a
#> 2 b

paths <- dfs %>%
imap_chr(~ format_path(.y, "csv", base = ".", prefix = "this-"))

``` r
list_csv() %>%
walk2(
imap_chr(dfms, ~ format_path(.y, "csv", base = ".", prefix = "this-")),
write.csv
)
walk2(dfs, paths, readr::write_csv)

dir_ls(".", regexp = "this-")
#> this-csv1.csv this-csv2.csv
Expand Down
273 changes: 169 additions & 104 deletions docs/index.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions docs/reference/format_path.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions docs/reference/list_any.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/format_path.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7fa5954

Please sign in to comment.