View source: R/parse_kegg_brite.R
parse_kegg_brite | R Documentation |
This script is a small utility to parse Kegg Brite XML files and return a regular data frame instead.
parse_kegg_brite(data)
data |
a data frame with 5 columns as input |
Changes that need to be made to the Kegg XML file before applying the function, simply using a text editor:
- replace double spaces ' '
by tabs '\t'
- remove first lines until regular content begins
- possibly add some trailing tabs or commas to end of first line (4 to 5)
so that read.table knows how many columns to expect
- read raw data frame into R using
read.table("/path/to/file", fill = TRUE, sep = "\t", row.names = NULL,
stringsAsFactors = FALSE, quote = "")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.