From 017f617105b19d6a0609eae4afb50198e42e13ce Mon Sep 17 00:00:00 2001 From: Jonathan Sidi Date: Mon, 7 Oct 2019 18:03:19 -0400 Subject: [PATCH] add instructions when clipboard is not available --- R/print.R | 3 +++ README.Rmd | 1 + README.md | 42 ++++-------------------------------------- tests/README.md | 24 ++++++++++++------------ 4 files changed, 20 insertions(+), 50 deletions(-) diff --git a/R/print.R b/R/print.R index 0aa0ffb..118ea85 100644 --- a/R/print.R +++ b/R/print.R @@ -16,6 +16,9 @@ print.details_console <- function(x,...){ #' @export print.details_clipr <- function(x,...){ + if(!clipr::clipr_available()) + stop('clipboard is not installed on the system, consider setting output to "edit"') + clipr::write_clip(x,...) } diff --git a/README.Rmd b/README.Rmd index eb33a79..be7edb2 100644 --- a/README.Rmd +++ b/README.Rmd @@ -127,3 +127,4 @@ More information can be found in the [articles](https://yonicd.github.io/details Please note that the 'details' project is released with a [Contributor Code of Conduct](https://github.com/yonicd/details/blob/master/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms. + diff --git a/README.md b/README.md index 54c67f9..47fd105 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ sessioninfo::session_info()%>% version R version 3.6.1 (2019-07-05) os macOS Mojave 10.14.5 system x86_64, darwin15.6.0 - ui RStudio + ui X11 language (EN) collate en_US.UTF-8 ctype en_US.UTF-8 @@ -102,41 +102,24 @@ sessioninfo::session_info()%>% ─ Packages ────────────────────────────────────────────────────────────── package * version date lib assertthat 0.2.1 2019-03-21 [1] - backports 1.1.5 2019-10-02 [1] cli 1.1.0 2019-03-19 [1] clipr 0.7.0 2019-07-23 [1] - covr * 3.3.0 2019-08-06 [1] - covrpage 0.0.70 2019-07-22 [1] crayon 1.3.4 2017-09-16 [1] - curl 4.2 2019-09-24 [1] - desc 1.2.0 2019-07-25 [1] details * 0.1.0 2019-10-07 [1] digest 0.6.21 2019-09-20 [1] evaluate 0.14 2019-05-28 [1] - git2r 0.26.1 2019-06-29 [1] - highr 0.8 2019-03-20 [1] htmltools 0.3.6.9004 2019-09-08 [1] httr 1.4.1 2019-08-05 [1] - knitr * 1.25 2019-09-18 [1] - lazyeval 0.2.2 2019-03-15 [1] - magrittr * 1.5 2014-11-22 [1] - mime 0.7 2019-06-11 [1] - packrat 0.5.0 2018-11-14 [1] - pkgload 1.0.2 2018-10-29 [1] + knitr 1.25 2019-09-18 [1] + magrittr 1.5 2014-11-22 [1] png 0.1-7 2013-12-03 [1] R6 2.4.0 2019-02-14 [1] Rcpp 1.0.2 2019-07-25 [1] - remotes 2.1.0 2019-06-24 [1] - rex 1.1.2 2017-10-19 [1] rlang 0.4.0 2019-06-25 [1] rmarkdown 1.14 2019-07-12 [1] - rprojroot 1.3-2 2018-01-03 [1] - rstudioapi 0.10 2019-03-19 [1] sessioninfo 1.1.1 2018-11-05 [1] stringi 1.4.3 2019-03-12 [1] stringr 1.4.0 2019-02-10 [1] - testthat * 2.2.1 2019-07-25 [1] - whisker 0.4 2019-08-28 [1] withr 2.1.2 2018-03-15 [1] xfun 0.10 2019-10-01 [1] xml2 1.2.2 2019-08-09 [1] @@ -146,16 +129,9 @@ sessioninfo::session_info()%>% CRAN (R 3.6.0) CRAN (R 3.6.0) CRAN (R 3.6.0) - CRAN (R 3.6.0) - local - CRAN (R 3.6.0) - CRAN (R 3.6.0) - Github (r-lib/desc@c860e7b) local CRAN (R 3.6.0) CRAN (R 3.6.0) - CRAN (R 3.6.0) - CRAN (R 3.6.0) Github (rstudio/htmltools@840d786) CRAN (R 3.6.0) CRAN (R 3.6.0) @@ -172,16 +148,6 @@ sessioninfo::session_info()%>% CRAN (R 3.6.0) CRAN (R 3.6.0) CRAN (R 3.6.0) - CRAN (R 3.6.0) - CRAN (R 3.6.0) - CRAN (R 3.6.0) - CRAN (R 3.6.0) - CRAN (R 3.6.0) - CRAN (R 3.6.1) - CRAN (R 3.6.0) - CRAN (R 3.6.0) - CRAN (R 3.6.0) - CRAN (R 3.6.0) [1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library ``` @@ -203,7 +169,7 @@ details(plot(x=mtcars$mpg,y=mtcars$wt), summary = 'My plot') My plot -![](https://i.imgur.com/HiDPAAI.png) +![](https://i.imgur.com/eOZq0Iz.png) diff --git a/tests/README.md b/tests/README.md index 1f63211..077fb81 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,6 +1,6 @@ Tests and Coverage ================ -07 October, 2019 09:25:11 +07 October, 2019 18:01:35 - [Coverage](#coverage) - [Unit Tests](#unit-tests) @@ -15,8 +15,8 @@ Coverage summary is created using the | Object | Coverage (%) | | :---------------------------- | :----------: | -| details | 89.01 | -| [R/print.R](../R/print.R) | 16.67 | +| details | 82.65 | +| [R/print.R](../R/print.R) | 7.69 | | [R/device.R](../R/device.R) | 88.24 | | [R/read.R](../R/read.R) | 88.89 | | [R/build.R](../R/build.R) | 100.00 | @@ -34,10 +34,10 @@ package. | file | n | time | error | failed | skipped | warning | | :------------------------------------------ | -: | ----: | ----: | -----: | ------: | ------: | -| [test-basic.R](testthat/test-basic.R) | 3 | 0.176 | 0 | 0 | 0 | 0 | -| [test-collapse.R](testthat/test-collapse.R) | 3 | 0.001 | 0 | 0 | 0 | 0 | -| [test-device.R](testthat/test-device.R) | 3 | 1.840 | 0 | 0 | 0 | 0 | -| [test-utils.R](testthat/test-utils.R) | 5 | 0.004 | 0 | 0 | 0 | 0 | +| [test-basic.R](testthat/test-basic.R) | 3 | 0.018 | 0 | 0 | 0 | 0 | +| [test-collapse.R](testthat/test-collapse.R) | 3 | 0.000 | 0 | 0 | 0 | 0 | +| [test-device.R](testthat/test-device.R) | 3 | 0.858 | 0 | 0 | 0 | 0 | +| [test-utils.R](testthat/test-utils.R) | 5 | 0.005 | 0 | 0 | 0 | 0 |
@@ -46,20 +46,20 @@ package. | file | context | test | status | n | time | | :-------------------------------------------------- | :-------- | :------------------------------ | :----- | -: | ----: | -| [test-basic.R](testthat/test-basic.R#L6_L9) | basic | basic: empty | PASS | 1 | 0.161 | +| [test-basic.R](testthat/test-basic.R#L6_L9) | basic | basic: empty | PASS | 1 | 0.003 | | [test-basic.R](testthat/test-basic.R#L13_L16) | basic | basic: object | PASS | 1 | 0.012 | | [test-basic.R](testthat/test-basic.R#L20_L23) | basic | basic: file | PASS | 1 | 0.003 | | [test-collapse.R](testthat/test-collapse.R#L6_L9) | fold | fold methods: close | PASS | 1 | 0.000 | | [test-collapse.R](testthat/test-collapse.R#L13_L16) | fold | fold methods: open default | PASS | 1 | 0.000 | -| [test-collapse.R](testthat/test-collapse.R#L20_L23) | fold | fold methods: open with summary | PASS | 1 | 0.001 | +| [test-collapse.R](testthat/test-collapse.R#L20_L23) | fold | fold methods: open with summary | PASS | 1 | 0.000 | | [test-device.R](testthat/test-device.R#L16) | device | using device: device flag | PASS | 1 | 0.001 | -| [test-device.R](testthat/test-device.R#L20) | device | using device: device png | PASS | 1 | 0.001 | -| [test-device.R](testthat/test-device.R#L24) | device | using device: device upload | PASS | 1 | 1.838 | +| [test-device.R](testthat/test-device.R#L20) | device | using device: device png | PASS | 1 | 0.000 | +| [test-device.R](testthat/test-device.R#L24) | device | using device: device upload | PASS | 1 | 0.857 | | [test-utils.R](testthat/test-utils.R#L6_L9) | utilities | utilities: tooltip default | PASS | 1 | 0.001 | | [test-utils.R](testthat/test-utils.R#L13_L16) | utilities | utilities: tooltip with text | PASS | 1 | 0.001 | | [test-utils.R](testthat/test-utils.R#L21_L24) | utilities | utilities: summary default | PASS | 1 | 0.001 | | [test-utils.R](testthat/test-utils.R#L28_L31) | utilities | utilities: state open | PASS | 1 | 0.001 | -| [test-utils.R](testthat/test-utils.R#L35_L38) | utilities | utilities: state closed | PASS | 1 | 0.000 | +| [test-utils.R](testthat/test-utils.R#L35_L38) | utilities | utilities: state closed | PASS | 1 | 0.001 |