When run this code,I will get an error:
genes<-colnames(survdata)[-c(1:3)]
univ_formulas<-sapply(genes,function(x)as.formula(paste('Surv(OS,status)~',x)))
Error in str2lang(x) : <text>:1:31: unexpected symbol
1: Surv(OS,status)~ ABC7-42389800N19.1
^
If I remove the element and run the code again, a similar error appears again:
univ_formulas<-sapply(genes,function(x)as.formula(paste('Surv(OS,status)~',x)))
Error in str2lang(x) : <text>:1:26: unexpected symbol
1: Surv(OS,status)~ CITF22-1A6.3
^
I don't know where the wrong is.
example of the data:
head(genes,n = 50)
[1] "A1BG" "A1BG-AS1" "A2M"
[4] "A2M-AS1" "A2ML1" "A2MP1"
[7] "A3GALT2" "A4GALT" "AAAS"
[10] "AACS" "AACSP1" "AADAT"
[13] "AAED1" "AAGAB" "AAK1"
[16] "AAMDC" "AAMP" "AANAT"
[19] "AAR2" "AARD" "AARS"
[22] "AARS2" "AARSD1" "AASDH"
[25] "AASDHPPT" "AASS" "AATF"
[28] "AATK" "AATK-AS1" "ABAT"
[31] "ABC7-42389800N19.1" "ABCA1" "ABCA10"
[34] "ABCA11P" "ABCA12" "ABCA13"
[37] "ABCA17P" "ABCA2" "ABCA3"
[40] "ABCA4" "ABCA5" "ABCA6"
[43] "ABCA7" "ABCA8" "ABCA9"
[46] "ABCB1" "ABCB10" "ABCB4"
[49] "ABCB6" "ABCB7"