MyNixOS website logo
Description

Partial 'rmarkdown' Documents to Prettify your Reports.

Use 'rmarkdown' partials, also know as child documents in 'knitr', so you can make components for HTML, PDF, and Word documents. The package provides various helper functions to make certain functions easier. You may want to use this package, if you want to flexibly summarise objects using a combination of figures, tables, text, and HTML widgets. Unlike HTML widgets, the output is Markdown and can hence be turn into other output formats than HTML.

rmdpartials

Travis-CI BuildStatus codecov

Simplify using rmarkdown partials to document objects in R

Description

Ever want to make a standardized way to report a summary of something like a regression, but did not want to limit yourself to one unformatted block of text, one table, or one figure?

Rmarkdown partials allow you to define standardised knitr code chunks that become part of your rmarkdown report. They can then be turned into HTML, PDFs, or Word files. You could, for example, create an rmarkdown partial to summarise regression models in a flexible way.

You can also define your partials as methods of knit_print, so that a rich rmarkdown partial is made by default.

Documentation

Confer the help or: https://rubenarslan.github.io/rmdpartials. See the vignette for a quick example of an HTML document generated with rmdpartials.

Install

To get the latest development version:

install.packages("remotes")
remotes::install_github("rubenarslan/rmdpartials")

Define a partial

Define a function like this:

my_summary <- function(object) {
  rmdpartials::partial("_my_summary.Rmd")
}

And create a file called _my_summary.Rmd with contents like this:

## My special summary

```{r}
summary(object)
```

## My special plot
```{r}
plot(object)
```

Usage

To use the partial in an rmarkdown report

```{r}
m1 <- lm(y ~ x, data = data)
my_summary(m1)
```

Usage as a knit_print method

To make your partial the default printing option for objects of a certain class when they are echoed in a knitr document, give it the name of a knit_print method.

knit_print.lm <- function(object) {
  rmdpartials::partial("_my_summary.Rmd")
}

Now, all you need to is let the lm object be echoed.

```{r}
m1 <- lm(y ~ x, data = data)
m1
```

You can also preview what the result from the partial would look like by calling it in an interactive session.

Code of conduct for contributing.

Metadata

Version

0.5.8

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows