guessTable: Guess table formats

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

View source: R/guessTable.R

Description

Guess format of data.frames by identifying captions and footnotes

Usage

1
guessTable(x, header = 1, ...)

Arguments

x

a data.frame, often loaded by read.xls

header

header row(s), after removing caption

...

other options passed to fixTypes

Details

Counts the number of non-empty cells in a data.frame and finds consecutive runs of 1 at the start and end, which are assigned to caption and footnote attributes. The remaining rows are reformated into a new data.frame

Value

a data.frame

Author(s)

Chris Stubben

See Also

read.xls2

Examples

1
2
3
4
5
x <- data.frame( rbind( c("Table 1. Loaded using read.xls", NA, NA, NA), letters[1:4], diag(4), c("* And some footnotes", NA, NA, NA )), stringsAsFactors=FALSE)
x
y <- guessTable(x)
y
str(y)

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