Skip to content

Instantly share code, notes, and snippets.

@shaheeng
Created April 11, 2016 21:16
Show Gist options
  • Save shaheeng/e86662c1c016c38c1c9a8a5612dd58c5 to your computer and use it in GitHub Desktop.
Save shaheeng/e86662c1c016c38c1c9a8a5612dd58c5 to your computer and use it in GitHub Desktop.
#make a new column factorQuality from the column quality -- make the label column categorical
rxFactors(inData = data_classi, outFile = data_classi, overwrite = TRUE,
factorInfo = list(factorQuality = list(varName = "quality")),reportProgress=0)
#can remove the column quality now
ColsToKeep = setdiff(names(data_classi),c('quality'))
data_classi = rxDataStep(inData = data_classi, outFile = 'data_classi_temp.xdf',varsToKeep = ColsToKeep, overwrite = TRUE)
#rename the label col 'factorQuality' as 'LabelsCol'
names(data_classi)[names(data_classi)=='factorQuality'] = 'LabelsCol'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment