Learn R Programming

tabplot (version 0.9-1)

num2fac: Function that creates a factor vector out of a numerical vector.

Description

Creates a factor vector out of a numerical vector. The levels can be determined by several methods. This function can be called via tableGUI.

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. interv
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 pretty
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