Learn R Programming

tabplot (version 0.11-1)

num2fac: Create a factor vector out of a numerical vector

Description

Create a factor vector out of a numerical vector. The levels can be determined by several methods.

Usage

num2fac(num, method = "pretty", num_scale = "auto", n =
  0, brks = NA)

Arguments

num
numeric vector
method
  • "pretty"intervals are determined by the base functionpretty
  • "kmeans"the method intervals are determined by the method kmeans wherenclusters (i.e.
num_scale
  • "auto"used scale is determined automatically
  • "lin"numis directly fed to the method pretty or kmeans
  • "log"a logarithmic transformation ofnumis fed to the method pre
n
the (desired) number of levels. n=0 means automatic
brks
breaks that determine the levels (only required when method="fixed")

Value

  • A factor vector