imputeMyData: Impute My Data

Description Usage Arguments Details Value Author(s) Examples

View source: R/impute_my_data.R

Description

Impute for missing values in given column in a given data by given method.

Usage

1

Arguments

df

data frame to impute

col

a column name of data frame to impute

FUN

a function to be used for imputing values one of(mean, median, sum, min, max)

Details

imputeMyData

Value

data frame after imputing the values

Author(s)

Jayachandra N

Examples

1
2
3
x <- head(iris)
x$Sepal.Length[1] <- NA
imputeMyData(x, "Sepal.Length", "mean")

Example output

Registered S3 method overwritten by 'quantmod':
  method            from
  as.zoo.data.frame zoo 
  Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1         4.92         3.5          1.4         0.2  setosa
2         4.90         3.0          1.4         0.2  setosa
3         4.70         3.2          1.3         0.2  setosa
4         4.60         3.1          1.5         0.2  setosa
5         5.00         3.6          1.4         0.2  setosa
6         5.40         3.9          1.7         0.4  setosa

shinyr documentation built on Oct. 21, 2021, 5:07 p.m.