powered by
Convert a numeric column in a data.frame to a factor
num2factor(data, call, name, no = 3)
A data.frame
a function call
character Name of numeric column
numeric
num2factor(anderson,name="logWBC") library(survival) fit=coxph(Surv(time,status)~logWBC+rx,data=anderson) num2factor(anderson,call=fit$call,name="logWBC",no=2)
Run the code above in your browser using DataLab