Learn R Programming

expss (version 0.5.1)

dtfrm: Make data.frame without conversion to factors and without fixing names

Description

dtfrm and as.dtfrm are shortcuts to data.frame and as.data.frame with stringsAsFactors = FALSE, check.names = FALSE. lst creates list with names.

Usage

dtfrm(...)
as.dtfrm(x, ...)
lst(...)

Arguments

...
objects, possibly named
x
object to be coerced

Value

data.frame/list

See Also

data.frame, as.data.frame, list

Examples

Run this code

# see the difference
df1 = data.frame(a = letters[1:3], "This is my long name" = 1:3)
df2 = dtfrm(a = letters[1:3], "This is my long name" = 1:3)

str(df1)
str(df2)

# lst
a = 1:3
b = 3:1

list1 = list(a, b)
list2 = lst(a, b)

str(list1)
str(list2)

Run the code above in your browser using DataLab