pmcTable: Format PMC tables as data.frames

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/pmcTable.R

Description

Formats PMC XML tables into a list of data.frames

Usage

1
pmcTable(doc, whichTable, simplify=TRUE, ...)

Arguments

doc

XML document from PMC

whichTable

table number to parse, default all tables

simplify

simplify to data frame if 1 table

...

other options passed to fixTypes

Details

Saves the caption and footnotes as attributes and uses rowspan and colspan attributes to format multi-line headers. Repeats cell values down columns if rowspan > 1 since single rows should stand-alone as a mention.

Value

A list of data.frames, or if simplify = TRUE and only 1 table, then a data.frame.

Author(s)

Chris Stubben

See Also

repeatSub to repeat subheadings

Examples

1
2
3
4
5
6
7
## Not run: 
doc <- pmcOAI("PMC2231364" )
x <- pmcTable(doc)
sapply(x, nrow)
x

## End(Not run)

cstubben/pmcXML documentation built on May 14, 2019, 12:25 p.m.