Skip to content

Commit

Permalink
Updated repo tools
Browse files Browse the repository at this point in the history
  • Loading branch information
phgrosjean committed May 1, 2024
1 parent 048712e commit 2e59117
Show file tree
Hide file tree
Showing 22 changed files with 110 additions and 66 deletions.
11 changes: 6 additions & 5 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
^\.DS_Store$
^\.Rproj\.user$
^.+\.Rproj$
^\.gitignore$
^\.git$
^\.github$
^\.DS_Store$
^Makefile$
^\.Rprofile$
^revdep$
^codecov\.yml$
^_pkgdown\.yml$
^pkgdown$
^docs$
^CODE_OF_CONDUCT\.md$
^FAQ\.md$
^LICENSE\.md$
^README\.Rmd$
^README\.Rmd$
^README\.md$
^TODO\.md$
^_pkgdown\.yml$
^pkgdown$
^docs$
data-raw
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ rsconnect/
# More files
inst/doc
docs
Meta
42 changes: 22 additions & 20 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,47 @@ Version: 0.6.0
Title: Create Tabular Outputs from R
Description: Create rich-formatted tabular outputs from R that can be
incorporated into R Markdown/Quarto documents with correct output at least in
HTML, LaTeX/PDF, Word and PowerPoint for various R objects.
Authors@R: c(
HTML, LaTeX/PDF, Word and PowerPoint formats for various R objects.
Authors@R: c(
person("Philippe", "Grosjean", role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-2694-9471")),
person("Guyliann", "Engels", role = "aut",
email = "[email protected]")
)
person("Guyliann", "Engels", role = c("aut"),
email = "[email protected]",
comment = c(ORCID = "0000-0001-9514-1014")))
Maintainer: Philippe Grosjean <[email protected]>
Depends:
R (>= 4.2.0)
Imports:
tinytable (>= 0.2.1),
commonmark (>= 1.9.0),
data.io (>= 1.5.0),
equatiomatic (>= 0.3.1),
flextable (>= 0.9.1),
generics (>= 0.1.3),
knitr (>= 1.42),
officer (>= 0.6.2),
knitr,
rlang (>= 1.1.1),
stats (>= 4.2.0),
svMisc (>= 1.4.0),
data.io,
utils,
stats,
commonmark,
generics,
equatiomatic
Suggests:
rmarkdown,
spelling,
tinytable (>= 0.2.1),
utils (>= 4.2.0)
Suggests:
equatags (>= 0.2.0),
rmarkdown (>= 2.21),
spelling (>= 2.2.1),
testthat (>= 3.0.0)
Remotes:
SciViews/svMisc,
ardata-fr/equatags,
datalorax/equatiomatic,
SciViews/data.io,
datalorax/equatiomatic
SciViews/svMisc
License: MIT + file LICENSE
URL: https://github.com/SciViews/tabularise, https://www.sciviews.org/tabularise/
BugReports: https://github.com/SciViews/tabularise/issues
ByteCompile: yes
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Config/testthat/edition: 3
VignetteBuilder: knitr
Encoding: UTF-8
Language: en-US
ByteCompile: yes
Config/testthat/edition: 3
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tabularise 0.6.0

- Add {tinytable} table generation for {tabularise} tables as an alternative to {flextable}.
- Add {tinytable} table generation for {tabularise} tables as an alternative to {flextable}. Argument `kind =` allows for selecting the table engine to use.

# tabularise 0.5.1

Expand Down
2 changes: 1 addition & 1 deletion R/tabularise.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#' tabularise(iris)
tabularise <- structure(
function(data, ..., type = "default", kind = "ft", env = parent.frame()) {
tb <- get_type("tabularise", type = type)(data, ..., kind = kind, env = env)
tb <- get_type("tabularise", type = type)(data, ..., kind = "ft", env = env)
# Solve different problems related to table captions in R Markdown or Quarto
opts_current <- knitr::opts_current
lbl <- opts_current$get('label')
Expand Down
2 changes: 1 addition & 1 deletion R/tabularise_coef.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' @export
#' @importFrom stats coef
#' @seealso [tabularise()], [stats::coef()]
tabularise_coef <- function(data, ..., env = env) {
tabularise_coef <- function(data, ..., kind = "ft", env = env) {
UseMethod("tabularise_coef")
}

Expand Down
2 changes: 1 addition & 1 deletion R/tabularise_confint.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#' @export
#' @importFrom stats confint
#' @seealso [tabularise()], [stats::confint()]
tabularise_confint <- function(data, ..., env = env) {
tabularise_confint <- function(data, ..., kind = "ft", env = env) {
UseMethod("tabularise_confint")
}

Expand Down
6 changes: 4 additions & 2 deletions R/tabularise_default.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#'
#' @param data An object
#' @param ... Further arguments (depending on the object class).
#' @param kind The kind of table to produce: "tt" for tinytable, or "ft" for
#' flextable (default).
#' @param env The environment where to evaluate formulas (you probably do not
#' need to change the default).
#'
Expand All @@ -20,14 +22,14 @@
#' tabularise$default(iris)
#' # Same as simply:
#' tabularise(iris)
tabularise_default <- function(data, ..., env = parent.frame()) {
tabularise_default <- function(data, ..., kind = "ft", env = parent.frame()) {
UseMethod("tabularise_default")
}

#' @export
#' @rdname tabularise_default
#' @method tabularise_default default
tabularise_default.default <- function(data, ..., env = parent.frame()) {
tabularise_default.default <- function(data, ..., kind = "ft", env = parent.frame()) {
res <- try(as_flextable(data, ...), silent = TRUE)
if (inherits(res, "try-error"))
stop("I don't know how to tabularise an object of class '",
Expand Down
2 changes: 1 addition & 1 deletion R/tabularise_glance.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' @export
#' @importFrom generics glance
#' @seealso [tabularise()], [generics::glance()]
tabularise_glance <- function(data, ..., env = env) {
tabularise_glance <- function(data, ..., kind = "ft", env = env) {
UseMethod("tabularise_glance")
}

Expand Down
2 changes: 1 addition & 1 deletion R/tabularise_tidy.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#' @export
#' @importFrom generics tidy
#' @seealso [tabularise()], [generics::tidy()]
tabularise_tidy <- function(data, ..., env = env) {
tabularise_tidy <- function(data, ..., kind = "ft", env = env) {
UseMethod("tabularise_tidy")
}

Expand Down
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ output: github_document

<!-- badges: start -->

[![R-CMD-check](https://github.com/SciViews/tabularise/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/SciViews/tabularise/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/SciViews/tabularise/branch/main/graph/badge.svg)](https://app.codecov.io/gh/SciViews/tabularise?branch=main) [![CRAN status](https://www.r-pkg.org/badges/version/tabularise)](https://CRAN.R-project.org/package=tabularise) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/SciViews/tabularise/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/SciViews/tabularise/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/SciViews/tabularise/branch/main/graph/badge.svg)](https://app.codecov.io/gh/SciViews/tabularise?branch=main) [![CRAN status](https://www.r-pkg.org/badges/version/tabularise)](https://CRAN.R-project.org/package=tabularise) [![r-universe status](https://sciviews.r-universe.dev/badges/tabularise)](https://sciviews.r-universe.dev/tabularise) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)

<!-- badges: end -->

Expand All @@ -21,10 +21,10 @@ With {tabularise} you should be able to obtain publication-ready (rich-formatted

## Installation

{tabularise} is not available from CRAN yet. You should install it from the [SciViews R-Universe](https://sciviews.r-universe.dev). The {equatags} package is an optional dependency of {flextable} to manage LaTeX equations in tables. The {data.io} package is useful too because it manages labels and units that {chart} uses. To install those three packages and their dependencies, run the following command in R:
{tabularise} is not available from CRAN yet. You should install it from the [SciViews R-Universe](https://sciviews.r-universe.dev). The {equatags} and {equatiomatic} packages are optional, but they are useful to display equations, both inline in R Markdown/Quarto documents and in {tabularise} tables. The {data.io} package is useful too because it manages labels and units that {chart} uses. To install those three packages and their dependencies, run the following command in R:

```{r, eval=FALSE}
install.packages(c('tabularise', 'equatags', 'data.io'),
install.packages(c('tabularise', 'equatags', 'equatiomatic', 'data.io'),
repos = c('https://sciviews.r-universe.dev', 'https://cloud.r-project.org'))
```

Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Create Tabular Outputs from R
coverage](https://codecov.io/gh/SciViews/tabularise/branch/main/graph/badge.svg)](https://app.codecov.io/gh/SciViews/tabularise?branch=main)
[![CRAN
status](https://www.r-pkg.org/badges/version/tabularise)](https://CRAN.R-project.org/package=tabularise)
[![r-universe
status](https://sciviews.r-universe.dev/badges/tabularise)](https://sciviews.r-universe.dev/tabularise)
[![License:
MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Lifecycle:
Expand All @@ -27,13 +29,14 @@ output them in HTML, LaTeX/PDF, Word or PowerPoint. See

{tabularise} is not available from CRAN yet. You should install it from
the [SciViews R-Universe](https://sciviews.r-universe.dev). The
{equatags} package is an optional dependency of {flextable} to manage
LaTeX equations in tables. The {data.io} package is useful too because
it manages labels and units that {chart} uses. To install those three
{equatags} and {equatiomatic} packages are optional, but they are useful
to display equations, both inline in R Markdown/Quarto documents and in
{tabularise} tables. The {data.io} package is useful too because it
manages labels and units that {chart} uses. To install those three
packages and their dependencies, run the following command in R:

``` r
install.packages(c('tabularise', 'equatags', 'data.io'),
install.packages(c('tabularise', 'equatags', 'equatiomatic', 'data.io'),
repos = c('https://sciviews.r-universe.dev', 'https://cloud.r-project.org'))
```

Expand Down
7 changes: 4 additions & 3 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
citHeader("To cite SciViews-R in publications, please use:")
citHeader("To cite SciViews-R in publications use:")

citEntry(
entry = "Manual",
title = "SciViews::R",
author = personList(as.person("Philippe Grosjean")),
author = personList(as.person("Philippe Grosjean"),
as.person("Guyliann Engels")),
organization = "UMONS",
address = "MONS, Belgium",
year = version$year,
url = "https://sciviews.r-universe.dev/",

textVersion =
paste("Grosjean, Ph. (", version$year, "). ",
paste("Grosjean, Ph. & Engels, G. (", version$year, "). ",
"SciViews::R. ",
"UMONS, Mons, Belgium. ",
"URL https://sciviews.r-universe.dev/.",
Expand Down
Binary file modified man/figures/README-unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions man/tabularise_coef.Rd

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

8 changes: 4 additions & 4 deletions man/tabularise_confint.Rd

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

7 changes: 5 additions & 2 deletions man/tabularise_default.Rd

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

8 changes: 4 additions & 4 deletions man/tabularise_glance.Rd

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

8 changes: 4 additions & 4 deletions man/tabularise_tidy.Rd

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

2 changes: 0 additions & 2 deletions vignettes/.gitignore

This file was deleted.

Loading

0 comments on commit 2e59117

Please sign in to comment.