[R] Running the cox model in R, through python or unix.

AoifeM aoife.doherty at liverpool.ac.uk
Thu May 22 18:20:59 CEST 2014


Hi guys, 

I have a piece of R code. Example code:

>R
>library(survival)
>ReadTable <- read.table("TestFile",header=F)
>CoxModel <-coxph(Surv(V1)~V2+V3+V4+V5,data=ReadTable)
>summary(CoxModel)
>plot(survfit(CoxModel))

I have to run this on 100 files, instead of 1 "TestFile", and get outputs of
100 plots and summaries, instead of one summary and plot.

Would anyone know how to run this set of R commands in a shell script on
unix, or through a python script? I've been trying to understand Rpy2, PypeR
and pyRserve, but I was wondering if someone had come across this before,
and could show me a simple example of running R commands (such as those
above) through unix or python.

Many thanks
Aoife





--
View this message in context: http://r.789695.n4.nabble.com/Running-the-cox-model-in-R-through-python-or-unix-tp4691077.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list