Package 'xglue'

Title: Extended glue. Write collapse and by Uses a template file with a special syntax.
Description: Extended glue. Add in the string to be glued blocks that specify collapse operations on vectors, and allow to operate on a grouped data frame
Authors: Sebastian Kranz
Maintainer: Sebastian Kranz <[email protected]>
License: GPL (>=2.0)
Version: 0.1.0
Built: 2024-12-17 02:55:26 UTC
Source: https://github.com/skranz/xglue

Help Index


Find nested blocks in a text

Description

Blocks must start and end with separate header and trailer lines, respectively e.g.

Usage

find.nested.blocks(txt, open = "#<", close = "#>")

Arguments

txt

a character vector

open

start of a block's header line, by default "#<"

close

start of a block's trailer line by default "#>".

Details

#< collapse ", "

#>


Perform xglue operation on a template text

Description

Perform xglue operation on a template text

Usage

xglue(
  txt,
  envir = parent.frame(),
  open = "{",
  close = "}",
  pre.open = "<<",
  pre.close = ">>",
  block.open = "#<",
  block.close = "#>",
  enclos = parent.frame(),
  newline = "<<newline>>",
  just.pre = FALSE
)

Arguments

txt

The template text on which xglue operations shall be performed

envir

Environment or list that contains objects whose value is spliced in. By default the environment from which xglue is called.

open

the opening string of glue whiskers

close

the closing string of glue whiskers

pre.open

the opening string of glue whiskers when pre compiling pre blocks

pre.close

the closing string of glue whiskers when pre compiling pre blocks

block.open

start of a block's header line, by default "#<"

block.close

start of a block's trailer line by default "#>".

enclos

If envir is a list the enclosing environment.

just.pre

Just compile the pre blocks and return the resulting template.

Value

The glued text as a single character