Description Usage Arguments Details Value Future Examples
from a text, gives back the positions of a word indicated by the associated intervals as defined in the function text3interval. The search can be constrained to specific columns. The output can also be restricted.
1 2 3 4 5 |
text |
A character vector containing the text (a component, a line). |
word |
character(1) the word to be found. |
column |
The columns where the first character of the word must found. c(1,1) means that it must be at the very start of a line. c(10,12) means that it must start on the 10th, 11th or 12th column of a line. |
which |
Which occurences of word (not the line numbers) must be returned defined by the number of the first one and the number of the last one. |
The word cannot be extended upon two successive lines but the same line can have more than one word. Be aware that overlapping patterns are not all detected (see one of the examples).
A four column matrix, each row corresponding to a word place with the help of
an interval.
For negative values of which, the order of occurences is reversed: the last
found will be in the first row of the matrix output.
Think of a way to introduce "end of line" as a possible word. Improve the case of overlapping patterns.
1 2 3 4 5 6 7 8 9 10 11 |
text3places8word(letters,"j");
text3places8word(letters,"J");
text3places8word(c("Il etait une fois","un petit et rouge chaperon"),"et");
text3places8word(c("Il etait une fois","un petit et rouge chaperon"),"et",which=c(2,3));
text3places8word(c("Il etait une fois","un petit et rouge chaperon"),"et",which=-c(1,3));
text3places8word(c("# Il etait une fois"," #un petit et rouge chaperon"),"#");
text3places8word(c("# Il etait une fois"," #un petit et rouge chaperon"),"#",column=c(1,2));
text3places8word(c("# Il etait une fois"," #un petit et rouge chaperon"),"#",column=c(2,2));
# overlapping pattern
text3places8word("aaaa","aa");
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.