cleanmix: Clean the mixture of data types

Description Usage Arguments Value Examples

Description

The function helps to delete the observations with unwanted data types in indicated columns in a data frame.

Usage

1
cleanmix(typemix_result, column, type, keep = TRUE)

Arguments

typemix_result

the returned result (a list of 3 data frames) by typemix function.

column

a number or a vector of numbers indicating the ID of columns where you want to apply the function to remove the mixture of data types

type

a vector specifying the data types that you want to keep or delete.

keep

if you want to keep or delete the data type you specify. The default setting is keep=TRUE.

Value

A data frame with observations in unwanted data types in the columns specified deleted.

Examples

1
2
3
4
5
6
7
8
sample_df<-data.frame(x1=c(1,2,3,"1.2.3"),
                   x2=c("test","test",TRUE,100),
                   x3=c(1,FALSE,"FALSE "," true"),
                   x4=c(1,2,3,4),
                   x5=c("t","t","t","t"),
                   x6=c(TRUE,TRUE,FALSE,FALSE))

cleanmix(typemix(sample_df),c(1,2),type=c("number","character"))

UBC-MDS/tidyplusR documentation built on May 25, 2019, 1:36 p.m.