Learn R Programming

r2rtf (version 1.0.2)

rtf_subset: Pass Table Attributes to Subset Table

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

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

Value

the subsetted data frame tbl_sub with original attributes from 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.

Specification

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

Examples

Run this code
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)

Run the code above in your browser using DataLab