FixToTab: Text to Table

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

Description

Convert a text to a table by using complete columns of spaces (or any other separator) as delimiting point.

Usage

1
FixToTab(txt, sep = " ", delim = "\t", trim = TRUE, header = TRUE)

Arguments

txt

the text to be partitioned. Works best, if txt is a matrix.

sep

the separator to use. Will frequently be " ".

delim

the new delimiter to insert. (default tab)

trim

logical. Should the separated text be trimmed from whitespace? Defaults to TRUE.

header

logical. Should the first line be interpreted as header?

Details

Only a complete appearance of the separator character in the same position over all rows will be accepted as column delimiter.

Value

a matrix of the separated text.

Author(s)

Andri Signorell <andri@signorell.net>

See Also

StrChop

Examples

1
2
3
# let's get some tabbed text
txt <- matrix(capture.output(Titanic[,,2,1]))
FixToTab(txt[-1,])


Search within the DescTools package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.