auto_context: Configure Automatic Context Calculation

Description Usage Arguments Value Examples

View source: R/set.R

Description

Helper functions to help define parameters for selecting an appropriate context value.

Usage

1
2
3
4
auto_context(
  min = getOption("diffobj.context.auto.min"),
  max = getOption("diffobj.context.auto.max")
)

Arguments

min

integer(1L), positive, set to zero to allow any context

max

integer(1L), set to negative to allow any context

Value

S4 object containing configuration parameters, for use as the context or parameter value in diff* methods

Examples

1
2
3
4
5
6
7
## `pager="off"` for CRAN compliance; you may omit in normal use
diffChr(letters, letters[-13], context=auto_context(0, 3), pager="off")
diffChr(letters, letters[-13], context=auto_context(0, 10), pager="off")
diffChr(
  letters, letters[-13], context=auto_context(0, 10), line.limit=3L,
  pager="off"
)

Example output

< letters     > letters[..
@@ 10,7 @@    @@ 10,6 @@  
  j             j         
  k             k         
  l             l         
< m           ~           
  n             n         
  o             o         
  p             p         
< letters     > letters[..
@@ 3,21 @@    @@ 3,20 @@  
  c             c         
  d             d         
  e             e         
  f             f         
  g             g         
  h             h         
  i             i         
  j             j         
  k             k         
  l             l         
< m           ~           
  n             n         
  o             o         
  p             p         
  q             q         
  r             r         
  s             s         
  t             t         
  u             u         
  v             v         
  w             w         
< letters   > letter..
@@ 13 @@    @@ 0 @@   
< m         ~         

diffobj documentation built on Oct. 5, 2021, 9:07 a.m.