fast_apply_nb_na {imp4p}R Documentation

Function similar to the function apply(X,dim,function(x)sum(is.na(x))).

Description

This function is similar to the function apply(X,dim,function(x)sum(is.na(x))) but written thanks to the Rcpp package and therefore faster than apply(X,dim,function(x)sum(is.na(x))).

Usage

fast_apply_nb_na(X, dim)

Arguments

X

A data matrix containing numeric and missing values.

dim

A numeric value: 1 if the number of missing values has to be computed for each row of X, or 2 if it has to be computed for each column of X.

Value

A numeric vector containing the number of missing values in either each row or each column of X.

Author(s)

Quentin Giai Gianetto <quentin2g@yahoo.fr>

Examples

## The function is currently defined as
##function (X, dim)
##{
##    .Call("imp4p_fast_apply_nb_na", PACKAGE = "imp4p", X, dim)
##  }

[Package imp4p version 0.7 Index]