2

As the title says really:

"C:\Program Files\R\R-3.3.2\bin\Rscript.exe" "D:\code\R\loadAndProcess.r" 10 ""DATA""

Fails. Any help is greatly appreciated!

Here, is parts of code:

library(jsonlite);
settings_url <- "D:/SETTINGS.json";
settings_paths <- fromJSON(txt=settings_url);          
setwd(settings_paths$R_code_paths$working_directory);
library(stringr)

par(ask=F);
proj <- NULL;

#function - normalize per data frame column - ignore NAs
normalizePerColumn <- function(dframe, exc){
    for(j in 1:length(dframe)){
        if(!((colnames(dframe[j]) %in% exc))){
          #todo try rm.na arg in max and min functions  
          notna_rows<-which(dframe[j]!="NA");
          if(length(notna_rows)!=0){
            temp <- as.numeric(as.vector(dframe[notna_rows,j]));
            dframe[notna_rows,j] <-(temp-min(temp))/(max(temp)-min(temp));
          }
        }
      } 
      dframe
}

#function - load & process
loadAndProcess <- function(args){  
    if (length(args)<3) { 
      stop("At least two arguments must be supplied #...", call.=FALSE);
    }      
    if(is.na(as.numeric(args[1]))){
        stop("The session id must be numeric!");
    }     
    #...
    print("DONE!...")
}
zx8754
  • 52,746
  • 12
  • 114
  • 209

0 Answers0