Use data.frame
with stringsAsFactors = FALSE
Arguments
- ...
passed to
data.frame
Examples
# data.frame() by default converts character to factor
str(data.frame(id = 1:3, letter = LETTERS[1:3]))
#> 'data.frame': 3 obs. of 2 variables:
#> $ id : int 1 2 3
#> $ letter: chr "A" "B" "C"
# noFactorDataFrame keeps character as character
str(noFactorDataFrame(id = 1:3, letter = LETTERS[1:3]))
#> 'data.frame': 3 obs. of 2 variables:
#> $ id : int 1 2 3
#> $ letter: chr "A" "B" "C"