path.string: Print path string

Description Usage Arguments Value Author(s) Examples

View source: R/path.string.R

Description

Print a hierarchical path string from an ordered list of names and levels

Usage

1

Arguments

x

ordered list of names

n

indentation level

Value

a character vector

Author(s)

Chris Stubben

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
x <- c("carnivores", "bears", "polar", "grizzly", "cats", "tiger", "rodents")
n <- c(1,2,3,3,2,3,1)
path.string(x, n)

## OR section titles
## Not run: 
id <- "PMC2612704"
doc <- pmcOAI(id)
 x <- xpathSApply(doc, "//body//sec/title", xmlValue)
 n <- xpathSApply(doc, "//body//sec/title", function(y) length(xmlAncestors(y) ))
path.string(y,n)

## End(Not run)

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