2011-04-05 95 views

回答

8

一般來說,我發現內置的幫助非常好。你是對的,但boxplot的幫助頁面提到na.action沒有說明選項是什麼。

在這種情況下,?na.action和 - 從那裏繼 - (這些是相當普遍的,也適用於其他的東西比boxplot?na.omit解釋的可能性

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’. 
+1

發佈的幫助文件全部內容是沒有答案。 'na.action'的一個問題是它很難理解。 – buhtz 2016-12-27 16:45:24