powered by
convert column to type factor
cols_to_factor(df, col_names)
dataframe
vector of column names or indices to convert to factor
# NOT RUN { df <- cols_to_factor(df, c("DOSE", "TRT")) # will convert dose and TRT columns to factor # }
Run the code above in your browser using DataLab