Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

variable_type

Determine type/class of a variable


Description

Determine type/class of a variable

Usage

variable_type(.var)

Arguments

.var

A vector, data frame column, or equivalent.

Value

One of "factor", "character", "numeric", "logical", "date".

Examples

var_d = as.Date("12.03.18", "%d.%m.%y")
var_f = factor(c("yes", "no"))
var_c = c("yes", "no")
var_n = 1:10
var_l = as.logical(c("true", "false"))
variable_type(var_d)
variable_type(var_f)
variable_type(var_c)
variable_type(var_n)
variable_type(var_l)

finalfit

Quickly Create Elegant Regression Results Tables and Plots when Modelling

v1.0.2
MIT + file LICENCE
Authors
Ewen Harrison [aut, cre], Tom Drake [aut], Riinu Ots [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.