I have written my code in the same way for Survival it worked out for me but not working for Coxph.
Mapper function:
I have data set which consits of some fields so i am taking some required rows using cbind and passing them to reducer...
DeviceData.map.fn <- function(k,v) {
mapObject<-cbind(v[2],v[7],v[3])
keyval(1, mapObject)
}
Reducer function:
Slot,DeviceFailed,Temp are my row headers in my dataset
DeviceData.reduce.fn<-function(k,v)
{
result<-survfit(coxph(Surv(Slot,DeviceFailed)~Temp,data=v),type="aalen")
keyval(k,result)
}
i am getting following error:
Loading required package: survival
Loading required package: splines
Loading required package: rhdfs
Loading required package: methods
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rhdfs', details:
call: fun(libname, pkgname)
error: Environment variable HADOOP_CMD must be set before loading package rhdfs
Warning in FUN(c("survival", "splines", "rhdfs", "rJava", "rmr2", "reshape2", :
can't load rhdfs
Loading required package: rmr2
Loading required package: Rcpp
Loading required package: RJSONIO
Loading required package: bitops
Loading required package: digest
Loading required package: functional
Loading required package: stringr
Loading required package: plyr
Loading required package: reshape2
terminate called after throwing an instance of 'Rcpp::not_compatible'
what(): expecting a single value
I need help on this
1) Is My mapper and reduce function is correct ?
2) If correct why i am getting this error for coxph as the same thing worked for Survival analysis.