axis_loc: Calculate pretty locations of axis tick marks

Description Usage Arguments Value Author(s) See Also Examples

View source: R/axes.R

Description

The pretty locations are calculated by the function pretty, but the locations that exceed the range of the data are removed. A special case is the factor: the locations are 1, 2, ..., up to the number of levels.

Usage

1

Arguments

x

the data vector (either numeric or factor)

Value

a numeric vector of the axis tick marks locations

Author(s)

Yihui Xie <http://yihui.name>

See Also

pretty

Examples

1
2
3
4
5
library(cranvas)
axis_loc(1)
axis_loc(c(0, 1))
axis_loc(rnorm(100))
axis_loc(iris$Species)  # a factor, so locations are 1, 2, 3

ggobi/cranvas documentation built on May 17, 2019, 3:10 a.m.