list4text: Analyses and prepares a list from a /text/

Description Usage Arguments Details Value Examples

View source: R/rbsa5.code.r

Description

from a text with convenient tags returns a named list. Labelling tags must be in first position of the lines, possibly after removing some precised character.

Usage

1
2
3
 
  list4text(text,content=c(1,length(text)),ccom="#",
            lndel=c("{","}"),lvdel=c("<<",">>")) 

Arguments

text

A character vector containing the text from which to extract the list.

content

Indicates which components of text to consider. Usually numeric(2) to indicate the interval of lines to consider. When numeric(1), only this line. When 0 or diff(content)<0 a list(0) is returned.

ccom

Character(s) at the beginning of lines to possibly be removed. When character(0) no removing is performed.

lndel

Starting and ending delimiters for the name of the item (at the beginning of the line).

lvdel

Starting and ending delimiters for the description of the item.

Details

Useless lines can exist before and after the list, and also between the list items.

Value

A named list.

Examples

1
2
3
4
5
6
 
  list4text(c("{a}<<Il etait une fois>>", 
  "{b}<<   un petit et rouge chaperon>>{c}", 
  "<< pas bon>>", 
  "{d}    <<et le m'echant loup...>>")) 
  list4text(c("{a}","<<","pour voir",">>")); 

rbsa documentation built on May 31, 2017, 4:29 a.m.