missing.fill.in | R Documentation |
This function uses the (non-missing) values from one column to fill in the missing values of another
missing.fill.in(x, var.from, var.to)
x |
a dataframe or matrix |
var.from |
secondary variable (of the same type and units) providing values to 'var.to' |
var.to |
primary variable with missing values to fill in by 'var.from' |
a modified dataframe with fewer missing values in the 'var.to' column
df <- data.frame(a=c(1,2,NA),b=c(1,NA,3),c=c(1,2,6))
missing.fill.in(df, 'c','a')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.