paste_tag: paste_tag makes an XML tag from a data-frame

View source: R/sbtab_to_vfgen.R

paste_tagR Documentation

paste_tag makes an XML tag from a data-frame

Description

given a data.frame, this function returns one string per row, using the data.frame column names as attribute names of an XML tag.

Usage

paste_tag(Name, Attributes, indent = " ")

Arguments

Name

the nameof the printed tag (" <Name [...]>")

Attributes

the data.frame containing the tag attributes to print (as strings)

indent

the printed string will be prefixed with this

Value

a character vector, one tag per row of Attributes argument

Examples

x <- data.frame(Name="a",Type="b",Formula="c")
tag <- paste_tag("Example",x)
message(tag) #  <Example Name="a" Type="b" Formula="c"/>

a-kramer/SBtabVFGEN documentation built on Nov. 14, 2024, 8:41 p.m.