inst/doc/z-split-a-rmd-or-qmd-file-into-a-tibble-and-vice-versa.R

## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup--------------------------------------------------------------------
library(lightparser)

## ----examples-----------------------------------------------------------------
file <- system.file(
  "dev-template-parsing.Rmd",
  package = "lightparser"
)
split_to_tbl(file)

## ----example-combine_tbl_to_file----------------------------------------------
file <- system.file("dev-template-parsing.Rmd",
  package = "lightparser"
)
# split first
tbl_rmd <- split_to_tbl(file)
# apply your filters
tbl_rmd_filtered <- tbl_rmd[-5, ]
# combine then
combine_tbl_to_file(tbl_rmd_filtered, tempfile(fileext = ".Rmd"))

Try the lightparser package in your browser

Any scripts or data that you put into this service are public.

lightparser documentation built on May 29, 2024, 4:39 a.m.