texttable: Import tables from various text formats

Description Usage Arguments Details Value Examples

Description

Parse tables from various formats into data frames.

Usage

1
texttable(text, format = NULL, trim_leading = TRUE, ...)

Arguments

text

A file, URL, or character string. Only length 1 inputs are allowed.

format

The format of the input text. The default will guess from the file extension of a file or URL, or default to Pandoc-flavored markdown for input passed as a character string. For allowable input types, see the Pandoc manual.

trim_leading

Should leading whitespace be trimmed from text input?

...

arguments to pass to html_table to specify how tables should be parsed.

Details

texttable converts the input to HTML via Pandoc and then imports tables via html_table.

Due to issues in pandoc, ODT and DocBook formats do not currently work.

Value

A list of data frames. Any tables with captions will have the caption as the list element name.

Examples

1
2
3
4
5
6
7
  texttable("https://raw.githubusercontent.com/jgm/pandoc/master/tests/tables.mediawiki")
  texttable("
             | My | Tabular  | Data |
             |----|----------|------|
             |   1| Sample 1 | 0.3  |
             |   2| Sample 2 | 1.2  |
            ")

noamross/texttable documentation built on May 23, 2019, 9:31 p.m.