I currently have a dataframe with 260,000 rows and 50 columns where 3 columns are numeric and the rest are categorical. I wanted to one hot encode the categorical columns in order to perform PCA and use regression to predict the class. How can I go about accomplishing the below example in R?
Example:
V1 V2 V3 V4 V5 .... VN-1 VN
to
V1_a V1_b V2_a V2_b V2_c V3_a V3_b and so on