I am trying to generate a nomogram with the following R code and keep on getting error for the last line. The error message says "Error in cph(Surv(futime, fustat) ~ ., x = T, y = T, surv = T, data = rt, : object 'n' not found". Could anyone please help? Thanks in advance.
library(rms)
setwd("C:\\Users\\yue\\Desktop\\04.diff")
rt=read.table("risk.txt",sep="\t",header=T,row.names=1,check.names=F)
rt=rt[c(1:(ncol(rt)-2))]
dd <- datadist(rt)
options(datadist="dd")
f <- cph(Surv(futime, fustat) ~ ., x=T, y=T, surv=T, data=rt, time.inc=1)