Description Usage Arguments Details Value Examples
View source: R/f0.rbsb1.code.r
This is a slight generalization of file2list
in the sense that
the component of the list have not to be given in the file but are
determined by the function from an additionnal line (everywhere in
the file) tagged with the second argument starting at the first
character. This line contains the list of bullets, giving then their
number. Notice that all proposed bullets must be different from
rbsb.l00
which can be modified if of use.
It is worth
explaining why such a function was written. The obvious one is that
not always names for the components of the list are natural. In
future version, it could be good to mixed with and without names.
Another reason is that the contraint of 'value only at the final
level' is not more natural. read8list
adds itself 'null'
components (named rbsb.l00
) to allow it. Finally, levels can
be skipped and missing levels are introduced.
Nevertheless,
everything has to be paid: now the constraint is that every component
must have a non empty content.
1 2 3 4 |
file |
file to be read and transformed into a list. |
bullet |
Indicates the bullets to be considered. This tags must be at the very beginning of a line. But the bullets can be preceeded by spaces. |
path |
Directory containing the file. |
clean |
Indicates if starting and ending spaces must be eliminated at first. |
ended |
To indicate the line from which to stop the reading. |
comme |
At the beginning of a line, it indicates that this line
must not be considered. More than one commenting character can be
considered when it is a vector. For instance |
skip |
To indicate set(s) of lines to be skipped. Must be a character matrix where the two columns correspond respectively to the opening and closing tags, and where each row is associate to a couple of tags. Tags are considered successively following the order of these matrix rows. |
include |
Tags to indicate a file (including possible path) by
a |
tags |
Character matrix with two columns indicating the opening and closing tags of the lists at different levels. Its row numbers gives the maximum number of levels. Opening tags must be different. |
sep |
Character sequence used to split the character vectors of
every line. Notice that |
rsep |
Indicates if repetitions of |
stag |
Two character strings indicating the tag to define
different |
An intermediary file is generated (and not deleted) to be read by
file2list
function; its names is given by the global constant
rbsb.fin
.
The numbering of the each level of the list is
determined by cycling the global constant rbsb.tly
.
Only
the first three arguments plus the tags are used by this function,
all others are directly passed to file2list
.
For the
moment, the numbering of the different levels does not take into
account the level hierarchy, this must be offered in next versions of
this function.
a list [of lists [of lists [...] ] ] of character (possibly named) vectors or matrices or arrays.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | rbsb3k("reset"); # for R checking convenience
sink("rbsb.list.txt")
cat(")BULLETS( * + -\n")
cat("* FIRST LEVEL 1\n");
cat(" + Second Level 1\n");
cat(" - third level 1\n");
cat(" - third level 2\n");
cat(" + Second Level 2\n");
cat(" + Second Level 3\n");
cat("* FIRST LEVEL 2\n");
cat(" + Second Level 1\n");
cat(" + Second Level 2\n");
cat(" - third level 1\n");
cat(" - third level 2\n");
cat("* FIRST LEVEL 3\n");
sink();
read8list("rbsb.list.txt");
unlink("rbsb.list.txt");
unlink(rbsb.fin);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.