rtf_subset: Pass Table Attributes to Subset Table

Description Usage Arguments Value Specification Examples

View source: R/rtf_subset.R

Description

Pass original table attributes assigned through like rtf_page, rtf_title, rtf_body... to subsetted table because original attributes won't be automatically carried over.

Usage

1
rtf_subset(tbl, row = 1:nrow(tbl), col = 1:ncol(tbl))

Arguments

tbl

A data frame with attributes.

row

a numeric vector for the row index to keep in the subsetted data.

col

a numeric vector for the column index to keep in the subsetted data.

Value

the subsetted data frame tbl_sub with original attributes from tbl

Specification

The contents of this section are shown in PDF user manual only.

Examples

1
2
3
4
5
6
7
library(dplyr)
data(r2rtf_tbl1)
sub_table <- r2rtf_tbl1 %>%
  rtf_body() %>%
  r2rtf:::rtf_subset(row = 1:2, col = c(1, 4:5))

attributes(sub_table)

r2rtf documentation built on Sept. 10, 2021, 1:06 a.m.