Какие есть варианты для na.action в boxplot? - PullRequest
11 голосов
/ 05 апреля 2011

Два вопроса, связанных с boxplot:

  1. Какие есть варианты для na.action? В документации их нет.
  2. Как мне ответить на подобные вопросы в будущем?

Ответы [ 2 ]

8 голосов
/ 06 апреля 2011

В общем, встроенная справка довольно хороша.Вы правы, хотя на странице справки для boxplot упоминается na.action без указания параметров.

В этом случае ?na.action и - после этого - ?na.omit объяснениевозможности (они носят общий характер и также относятся к вещам, отличным от boxplot.)

Handle Missing Values in Objects

Description:

     These generic functions are useful for dealing with ‘NA’s in e.g.,
     data frames.  ‘na.fail’ returns the object if it does not contain
     any missing values, and signals an error otherwise.  ‘na.omit’
     returns the object with incomplete cases removed.  ‘na.pass’
     returns the object unchanged.

Usage:

     na.fail(object, ...)
     na.omit(object, ...)
     na.exclude(object, ...)
     na.pass(object, ...)

Arguments:

  object: an R object, typically a data frame

     ...: further arguments special methods could require.

Details:

     At present these will handle vectors, matrices and data frames
     comprising vectors and matrices (only).

     If ‘na.omit’ removes cases, the row numbers of the cases form the
     ‘"na.action"’ attribute of the result, of class ‘"omit"’.

     ‘na.exclude’ differs from ‘na.omit’ only in the class of the
     ‘"na.action"’ attribute of the result, which is ‘"exclude"’.  This
     gives different behaviour in functions making use of ‘naresid’ and
     ‘napredict’: when ‘na.exclude’ is used the residuals and
     predictions are padded to the correct length by inserting ‘NA’s
     for cases omitted by ‘na.exclude’.
0 голосов
/ 23 сентября 2018

Эта опция помогает программному обеспечению R игнорировать пропущенные значения во время вычислений и построения графиков:

na.rm=TRUE
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...