Die Funktion cut()

Die Funktion cut() ist praktisch, um eine kontinuierliche Variable in diskrete Einzelteile zu zerlegen. Die Standardvariante von cut() für numerische Vektoren sieht so aus:

cut(x, breaks, labels = NULL,
    include.lowest = FALSE, right = TRUE,
    dig.lab = 3, ordered_result = FALSE, ...)

Außerdem gibt es eine Version von cut() zur Bearbeitung von Objekten der Klasse Date:

cut(x, breaks, labels = NULL,
    start.on.monday = TRUE, right = FALSE,
    ...)

Die Funktion cut() übernimmt also entweder einen numerischen oder einen Datumsvektor und gibt einen Faktor zurück, in dem jedes Level einem Intervall der Werte des Eingabevektors entspricht. Es folgt eine Beschreibung der Argumente von cut() in der numerischen Form.

Argument

Beschreibung

Standardwert ...

Get R in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.