The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
otter is a small collection of functions that are useful for me, Ott, and hopefully for others too. Sharing is caring!
Currently otter provides rtf_to_df(), which parses RTF
files and extracts embedded tables into a data frame. It automatically
detects header rows, handles multi-page and multi-table RTF output, and
supports non-UTF-8 encodings.
You can install the development version of otter from GitHub with:
# install.packages("pak")
pak::pak("ottvahtrik/otter")rtf_to_df() reads an RTF table and returns its contents
as a data frame:
library(otter)
path <- system.file("extdata", "example.rtf", package = "otter")
rtf_to_df(path, include_header = TRUE)
#> Name Value
#> 1 Alice 10
#> 2 Bob 20If the RTF file contains multiple distinct tables, use
table_index to select one of them:
multi_path <- system.file("extdata", "multi_table_example.rtf", package = "otter")
rtf_to_df(multi_path, include_header = TRUE, table_index = 2L)
#> C D
#> 1 3 4These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.