infer_dtype: infer variable data type

infer_dtypeR Documentation

infer variable data type

Description

infer variable data type

Usage

infer_dtype(x, gsub_pattern = "<|>", n_un_lim = 5, n_un_perc_lim = 10)

Arguments

x

variable of interest

gsub_pattern

regex for str to remove (e.g., '<|>')

n_un_lim

number of unique values in x to define numeric (see details)

n_un_perc_lim

fraction of unique values in x to define numeric (see details)

Details

dtype inferred is one of num, str, logic, x should be free of na or non-informative values (see fct .rm_na). Parameters n_un_lim and n_un_frac_lim define absolute and fraction of unique values, respectively, to define x as numeric. This is to exclude categorical values from being defined as numeric (e.g., x levels of low medium high).

Value

data type as string


tkimhofer/cleansing documentation built on Oct. 25, 2022, 1:12 a.m.