encode.character: Encode character vector with numeric values

Description Usage Arguments Value

Description

encode.character takes a character column of a dataframe and returns it converted with numeric values. It is also possible to return the correspondance between the numeric values and the initial characters

Usage

1
encode.character(df, char.var = "Country_Transco", codelist = T)

Arguments

df

Dataframe

char.var

Character variable name that should be converted

codelist

If FALSE, a numeric vector is returned with numeric codes. If TRUE, a dataframe is returned indicating the correspondance between the numeric values and the initial character vector

Value

A dataframe of two columns or a numeric vector


EpidemiumOpenCancer/OpenCancer documentation built on May 12, 2019, 7:46 a.m.