R is saving empty sheets for several KM plots using RTCGA package
0
0
Entering edit mode
2.8 years ago

Hi!

I have an issue when I'm trying to save several plots in a pdf file using R.

I created these plots using the RTCGA package. The command to generate one plot is the next:

kmTCGA(my_data, ##My data is stored in a list
   explanatory.names = "TP53", 
   pval = T, 
   conf.int = F,  
   risk.table = F)

To save multiple plots I'm using the next code:

pdf("../mypath/KMplots.pdf", height = 8, width = 10)
for(i in names(categories)){ ##names of my datasets inside the list
  for(j in variables){ ##Names of the genes I'm analyzing
    print(kmTCGA(categories[[i]], 
           explanatory.names = j, 
           pval = T, 
           conf.int = F, 
           risk.table = F))
  }
}
dev.off()

However, when I inspect the pdf file the first page is empty or in leaved in blank. Does anyone know how to save my data without this empty page?

The same problem occurs when I generate a pdf file with cutoffs plots from survminer package:

pdf("../my_path/Cutpoints.pdf", height = 8, width = 10)
for(i in data){
  for(j in variables){
    print(plot(cut_points[[i]], j))
  }
}
dev.off()

Thanks in advance!

Rodo

RTCGA R • 608 views
ADD COMMENT

Login before adding your answer.

Traffic: 1876 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6