text3stext: returns a subtext

Description Usage Arguments Details Value Examples

View source: R/rbsa5.code.r

Description

from a text, gives back a portion according to the sub argument. Delimiting positions are included, so sub=c(1,1,1,1) gives back the first character of text.

Usage

1
2
 
  text3stext(text,sub=c(l1=1,p1=1,l2=Inf,p2=Inf)) 

Arguments

text

A character vector containing the text (a component, a line).

sub

A numeric(4) indicating the portion of the text to consider; can be a matrix but only one row is allowed. See the function text3interval for details.

Details

Definition of the subtext is flexible (outside positions are interpreted as minimum / maximum positions).

Value

The resulting sub-text

Examples

1
2
3
4
5
6
7
8
 
  aa <- c(paste(letters,collapse=""),paste(LETTERS,collapse=""),paste(0:9,collapse="")); 
  text3stext(aa); 
  text3stext(aa,c(1,12,1,15)); 
  text3stext(aa,c(1,12,2,15)); 
  text3stext(aa,c(1,12,3,15)); 
  # In this last example, the last character of line 2 is kept (flexibility)! 
  text3stext(aa,c(2,68,3,15)); 

rbsa documentation built on May 2, 2019, 6:07 p.m.