Skip to content

replacement has length zero #12

@kumarsaurabh20

Description

@kumarsaurabh20

I am receiving an error "Error in norm_val[i, ] <- dummy : replacement has length zero" with the following code:
R.eval <<-EOF

columns <- matrix(0, length(probes), count)

 for (i in c(1:count)) {
     if (i == 1) { columns <- cbind(get(paste0("col",i))) } 
     else { columns <- cbind(columns, get(paste0("col",i))) }    
     }

norm_val <- matrix(0, length(norm_probes), ncol(columns) - 1)

    for (i in 1:length(norm_probes)) {
    dummy <- columns[norm_probes[i] == columns[,1],]
    print(dummy)
    dummy <- dummy[-1]
    print(dummy)
    norm_val[i,] <- dummy
    }

EOF

 return R.pull "norm_val"

I dont know where to ask this question as its very particular with RinRuby. The code is working fine in R terminal.

Here it says:
print('RINRUBY.EVAL.FLAG')
Matrix[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]

this matrix is suppose to be filled with values but its coming empty??
Is there a limit in integer or character sizes which we pass to R from Ruby??

complete code is here, just incase you need it:
https://github.com/kumarsaurabh20/PlotApp/blob/master/app/controllers/uploads_controller.rb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions