Description Usage Arguments Value Examples
View source: R/f0.rbsb1.code.r
reads a conveniently tagged file into nested lists. It is just the
linking of the two functions file2char
and char2list
,
see their comments for the description of the arguments.
1 2 3 4 |
file |
file to be read and transformed into a list. |
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 |
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("# comments can be included as well\n")
cat("<<A>>\n");
cat("[[a]]/*/v 1*un deux trois\n");
cat("[[b]]/*/v 1*2*3\n");
cat("un uno one\n");
cat("deux dos two\n");
cat("trois tres three\n");
cat("<<B>>\n");
cat("[[a]] un deux trois\n");
cat("# the following three are interesting\n");
cat("[[b]] un uno one\n");
cat(" deux dos two\n");
cat("trois tres three\n");
cat("<<C>> 1 2 3\n");
sink();
file2list("rbsb.list.txt");
unlink("rbsb.list.txt");
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.