Skip to content

Commit

Permalink
Merge d4cf593 into 9ccb6ed
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolepore committed Mar 7, 2020
2 parents 9ccb6ed + d4cf593 commit 23a8b1c
Show file tree
Hide file tree
Showing 22 changed files with 327 additions and 87 deletions.
23 changes: 10 additions & 13 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
^vignettes$
^\.buildignore$
^vignettes/siteonly$
^cran-comments\.md$
^CRAN-RELEASE$
^docs$
^_pkgdown\.yml$
^\.travis\.yml$
^.*\.Rproj$
^LICENSE\.md$
^README\.Rmd$
^\.Rproj\.user$
^.*\.Rproj$
^tor\.Rpoj$

^tmp\.R$
^\.github$
^\.travis\.yml$
^_pkgdown\.yml$
^codecov\.yml$
^cran-comments\.md$
^csv1\.csv$
^csv2\.csv$
^\.github$
^tor\.Rpoj$
^vignettes$

^vignettes/articles$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
89 changes: 89 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: '3.6'}
- {os: macOS-latest, r: '3.6'}
- {os: macOS-latest, r: 'devel'}
- {os: ubuntu-16.04, r: '3.2', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.3', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.4', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.5', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
CRAN: ${{ matrix.config.cran }}

steps:
- uses: actions/checkout@v1

- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
library(remotes)
deps <- readRDS("depends.Rds")
deps[["installed"]] <- vapply(deps[["package"]], remotes:::local_sha, character(1))
update(deps)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

- name: Test coverage
if: matrix.config.os == 'macOS-latest' && matrix.config.r == '3.6'
run: covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")
shell: Rscript {0}
24 changes: 24 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
branches: master

name: Pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
steps:
- uses: actions/checkout@master
- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-pandoc@master
- name: Install dependencies
run: |
install.packages("remotes")
remotes::install_deps(dependencies = TRUE)
remotes::install_dev("pkgdown")
shell: Rscript {0}
- name: Install package
run: R CMD INSTALL .
- name: Deploy package
run: pkgdown::deploy_to_branch(new_process = FALSE)
shell: Rscript {0}
52 changes: 52 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
issue_comment:
types: [created]
name: Commands
jobs:
document:
if: startsWith(github.event.comment.body, '/document')
name: document
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: r-lib/actions/pr-fetch@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@master
- name: Install dependencies
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
- name: commit
run: |
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
style:
if: startsWith(github.event.comment.body, '/style')
name: style
runs-on: macOS-latest
steps:
- uses: actions/checkout@master
- uses: r-lib/actions/pr-fetch@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@master
- name: Install dependencies
run: Rscript -e 'install.packages("styler")'
- name: Style
run: Rscript -e 'styler::style_pkg()'
- name: commit
run: |
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# A mock job just to ensure we have a successful build status
finish:
runs-on: ubuntu-latest
steps:
- run: true
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 6.1.1
RoxygenNote: 7.0.2
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# tor

* Simplify articles structure.
* Use GitHub actions.
* Use codecov.
* No longer assume `stringsAsFactor` defaults to `TRUE`.
* Add contributing info.
* Check with R 3.4 on TravisCI.
* Require R >= 3.2 (checked on travis).
Expand Down
3 changes: 3 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ knitr::opts_chunk$set(

# tor

<!-- badges: start -->
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![Travis build status](https://travis-ci.org/maurolepore/tor.svg?branch=master)](https://travis-ci.org/maurolepore/tor)
[![Codecov test coverage](https://codecov.io/gh/maurolepore/tor/branch/master/graph/badge.svg)](https://codecov.io/gh/maurolepore/tor?branch=master)
[![Coverage status](https://coveralls.io/repos/github/maurolepore/tor/badge.svg)](https://coveralls.io/r/maurolepore/tor?branch=master)
[![CRAN status](https://www.r-pkg.org/badges/version/tor)](https://cran.r-project.org/package=tor)
<!-- badges: end -->

__tor__ (_to-R_) helps you to import multiple files at once. For example:

Expand Down
55 changes: 32 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@

# tor

<!-- badges: start -->

[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![Travis build
status](https://travis-ci.org/maurolepore/tor.svg?branch=master)](https://travis-ci.org/maurolepore/tor)
[![Codecov test
coverage](https://codecov.io/gh/maurolepore/tor/branch/master/graph/badge.svg)](https://codecov.io/gh/maurolepore/tor?branch=master)
[![Coverage
status](https://coveralls.io/repos/github/maurolepore/tor/badge.svg)](https://coveralls.io/r/maurolepore/tor?branch=master)
[![CRAN
status](https://www.r-pkg.org/badges/version/tor)](https://cran.r-project.org/package=tor)
<!-- badges: end -->

**tor** (*to-R*) helps you to import multiple files at once. For
example:

- Run `list_rds()` to import all .rds files from your working
- Run `list_rds()` to import all .csv files from your working
directory into a list.
- Run `load_csv()` to import all .csv files from your working
directory into your global environment.
Expand Down Expand Up @@ -46,12 +51,11 @@ All functions default to importing files from the working directory.

``` r
dir()
#> [1] "_pkgdown.yml" "cran-comments.md" "csv1.csv"
#> [4] "csv2.csv" "DESCRIPTION" "docs"
#> [7] "inst" "LICENSE.md" "man"
#> [10] "NAMESPACE" "NEWS.md" "R"
#> [13] "README.md" "README.Rmd" "tests"
#> [16] "tmp.R" "tor.Rproj" "vignettes"
#> [1] "_pkgdown.yml" "codecov.yml" "cran-comments.md" "csv1.csv"
#> [5] "csv2.csv" "DESCRIPTION" "inst" "LICENSE.md"
#> [9] "man" "NAMESPACE" "NEWS.md" "R"
#> [13] "README.md" "README.Rmd" "tests" "tor.Rproj"
#> [17] "vignettes"

list_csv()
#> Parsed with column specification:
Expand Down Expand Up @@ -85,7 +89,7 @@ tor_example()
#> [1] "csv" "mixed" "rdata" "rds" "tsv"

(path_rds <- tor_example("rds"))
#> [1] "C:/Users/LeporeM/Documents/R/win-library/3.5/tor/extdata/rds"
#> [1] "/home/mauro/R/x86_64-pc-linux-gnu-library/3.6/tor/extdata/rds"
dir(path_rds)
#> [1] "rds1.rds" "rds2.rds"

Expand Down Expand Up @@ -153,7 +157,7 @@ read with.

``` r
(path_csv <- tor_example("csv"))
#> [1] "C:/Users/LeporeM/Documents/R/win-library/3.5/tor/extdata/csv"
#> [1] "/home/mauro/R/x86_64-pc-linux-gnu-library/3.6/tor/extdata/csv"
dir(path_csv)
#> [1] "csv1.csv" "csv2.csv"

Expand Down Expand Up @@ -181,7 +185,7 @@ It understands lambda functions and formulas (powered by
library(magrittr)

(path_rdata <- tor_example("rdata"))
#> [1] "C:/Users/LeporeM/Documents/R/win-library/3.5/tor/extdata/rdata"
#> [1] "/home/mauro/R/x86_64-pc-linux-gnu-library/3.6/tor/extdata/rdata"
dir(path_rdata)
#> [1] "rdata1.rdata" "rdata2.rdata"

Expand Down Expand Up @@ -319,12 +323,11 @@ into the global environment.
``` r
# The working directory contains .csv files
dir()
#> [1] "_pkgdown.yml" "cran-comments.md" "csv1.csv"
#> [4] "csv2.csv" "DESCRIPTION" "docs"
#> [7] "inst" "LICENSE.md" "man"
#> [10] "NAMESPACE" "NEWS.md" "R"
#> [13] "README.md" "README.Rmd" "tests"
#> [16] "tmp.R" "tor.Rproj" "vignettes"
#> [1] "_pkgdown.yml" "codecov.yml" "cran-comments.md" "csv1.csv"
#> [5] "csv2.csv" "DESCRIPTION" "inst" "LICENSE.md"
#> [9] "man" "NAMESPACE" "NEWS.md" "R"
#> [13] "README.md" "README.Rmd" "tests" "tor.Rproj"
#> [17] "vignettes"

load_csv()
#> Parsed with column specification:
Expand Down Expand Up @@ -357,7 +360,7 @@ You may import files from a specific `path`.

``` r
(path_mixed <- tor_example("mixed"))
#> [1] "C:/Users/LeporeM/Documents/R/win-library/3.5/tor/extdata/mixed"
#> [1] "/home/mauro/R/x86_64-pc-linux-gnu-library/3.6/tor/extdata/mixed"
dir(path_mixed)
#> [1] "csv.csv" "lower_rdata.rdata" "rda.rda"
#> [4] "upper_rdata.RData"
Expand Down Expand Up @@ -392,12 +395,11 @@ file of the format you want to import.

``` r
dir()
#> [1] "_pkgdown.yml" "cran-comments.md" "csv1.csv"
#> [4] "csv2.csv" "DESCRIPTION" "docs"
#> [7] "inst" "LICENSE.md" "man"
#> [10] "NAMESPACE" "NEWS.md" "R"
#> [13] "README.md" "README.Rmd" "tests"
#> [16] "tmp.R" "tor.Rproj" "vignettes"
#> [1] "_pkgdown.yml" "codecov.yml" "cran-comments.md" "csv1.csv"
#> [5] "csv2.csv" "DESCRIPTION" "inst" "LICENSE.md"
#> [9] "man" "NAMESPACE" "NEWS.md" "R"
#> [13] "README.md" "README.Rmd" "tests" "tor.Rproj"
#> [17] "vignettes"

load_any(".", .f = readr::read_csv, regexp = "[.]csv$")
#> Parsed with column specification:
Expand Down Expand Up @@ -429,3 +431,10 @@ csv2
Two great packages to read and write data are
[**rio**](https://CRAN.R-project.org/package=rio) and
[**io**](https://CRAN.R-project.org/package=io).

## Information

- [Getting help](https://maurolepore.github.io/tor/SUPPORT.html).
- [Contributing](https://maurolepore.github.io/tor/CONTRIBUTING.html).
- [Contributor Code of
Conduct](https://maurolepore.github.io/tor/CODE_OF_CONDUCT.html).
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ navbar:
menu:
- text: "Release notes"
- text: "Version 1.1.1"
href: articles/siteonly/tor-1-1-1.html
href: articles/tor-1-1-1.html
- text: "------------------"
- text: "Change log"
href: news/index.html
Expand Down
12 changes: 12 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
patch:
default:
target: auto
threshold: 1%
3 changes: 2 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
codecov
Codecov
csv
fs
io
lifecycle
onment
ORCID
rds
readr
rio
rlang
Expand Down
Loading

0 comments on commit 23a8b1c

Please sign in to comment.