Learn R Programming

PKPDmisc (version 2.1.2)

cols_to_factor: convert column to type factor

Description

convert column to type factor

Usage

cols_to_factor(df, col_names)

Arguments

df

dataframe

col_names

vector of column names or indices to convert to factor

Examples

Run this code
# 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