asciiruler {asciiruler} | R Documentation |
Generate an ascii ruler
Description
'
' v borders ' +-----------------------------------------------------------------+<-borders ' |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<-dense_ticks ' | | | | | | | | | | | | | | |<-sparse_ticks ' |-30 -20 -10 0 10 20 30 | ' +-----------------------------------------------------------------+<-borders '
Usage
asciiruler(low = 0L, high = 50L, sparse_ticks = 5L, dense_ticks = TRUE,
block_space = 0L, borders = FALSE, numbers_down = TRUE,
line_break = "\n", strict_width = FALSE)
default.asciiruler(x)
Arguments
low |
the range start, can be negative |
high |
the range end, can be negative |
sparse_ticks |
intermittent ticks appear every sparse_ticks, set to 0 to hide row |
dense_ticks |
display a row of ticks at every position |
block_space |
break up the ruler with a space every block_space blocks encountered, a multiple of sparse_ticks, set to 0 to disable |
borders |
display borders |
numbers_down |
display the ruler so the numbers are below the ticks |
line_break |
the line break character(s) |
strict_width |
hide numbers whose display would force the ruler to be wider than width(high-low) |
x |
the asciiruler |
Value
asciiruler object with the following slots:
- output
delimited ruler string ready to cat
- content
vector of lines comprising the ruler
- width
width of ruler
- leftmargin
position of the first tick relative to the left edge of the ruler
References
Inspired by http://codegolf.stackexchange.com/questions/4910/ascii-ruler-generation
Examples
asciiruler(low=-30,high=30,borders=TRUE)