Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replacement has length zero #12

Open
kumarsaurabh20 opened this issue May 2, 2014 · 1 comment
Open

replacement has length zero #12

kumarsaurabh20 opened this issue May 2, 2014 · 1 comment

Comments

@kumarsaurabh20
Copy link

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

@clbustos
Copy link
Owner

clbustos commented May 2, 2014

I will take a look at this. Thanks for reporting
El may 2, 2014 10:30 a.m., "JstRoRR" notifications@github.com escribió:

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


Reply to this email directly or view it on GitHubhttps://github.com//issues/12
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants