Learn R Programming

OpasnetUtils (version 1.3)

fillna: Interpreting empty locations in indices

Description

Copies result rows that have NAs as index values and replaces the index value with all available values of that index.

Usage

fillna(object, marginals)

Arguments

object

a data.frame to be filled

marginals

integer, positions of columns whose locations contain NAs that should be duplicated

Value

Returns a data.frame

Details

Runs dropall before duplication to avoid unnecessary levels.

See also: http://en.opasnet.org/

Examples

Run this code
a <- data.frame(A = c("a", "b", NA), B = c(1, 2, 3))
fillna(a, 1)

Run the code above in your browser using DataLab