#if data provided (as data.frame or matrix...): binarize it, and add it as first argument
if (!is.null(data))
{
- write.csv(data, "/tmp/data_csv")
- system(paste(path,"/ppam.exe serialize /tmp/data_csv /tmp/data_bin 0 0",sep=""))
- command_line = paste(command_line," ","/tmp/data_bin",sep="")
+ if (!is.character(data))
+ {
+ #assuming matrix or data.frame, WITH row names (identifiers; could be line number...)
+ write.csv(data, "/tmp/data_csv", row.names=TRUE, col.names=FALSE)
+ system(paste(path,"/ppam.exe serialize /tmp/data_csv /tmp/data_bin 0 0",sep=""))
+ } else
+ {
+ system(paste(path,"/ppam.exe serialize ",data," /tmp/data_bin 0 0",sep=""))
+ }
+ command_line = paste(command_line," /tmp/data_bin",sep="")
}
command_line = paste(command_line," ",args,sep="")