Description Usage Arguments Details Value Examples
View source: R/f0.rbsb1.code.r
reads a conveniently tagged file to produce a vector of character where all non used lines are eliminated. Each component of the resulting vector is associated to an original line.
1 2 3 |
file |
file which have 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 |
Performed actions are : (i) eliminating commented lines, (ii)
eliminating lines after a 'stop', (iii) including indicated files,
(iv) skipping sequences of lines and (v) cleaning the line, i.e.
removing starting and ending spaces.
All tags are supposed to be
in the first position of the line after cleaning when asked.
a character of length, the number of retained lines.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | rbsb3k("reset"); # for R checking convenience
sink("rbsb.char.txt")
cat("# comments can be included as well\n")
cat(" something\n");
cat("/* skipping from here\n");
cat("blablabla\n");
cat(" */ until here (this line is ALSO eliminated\n");
cat(" interesting:\n");
cat("un dos tres\n");
cat(")STOP(\n");
cat(" It is finished!\n");
cat(" Don't insist!\n");
sink();
file2char("rbsb.char.txt");
unlink("rbsb.char.txt");
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.