image(R) error

Hello everyone!

I've been using KNIME for a few months now and started to look into using R snipets lately. And I've encountered a rather annoying problem on the way:

An R View node with the sole snippet of "image(R)" gives me the error message:

"Execute failed: Execution of R script failed: Calls: image -> image.default"

Regardless of the input table I'm using.

 

This can be circumvented if I feed the variable R with the columns provided by the input table. But only if I use the names of these columns.

This means

R <- matrix(c(R$"Columnname1",R$"Columnname2",R$"Columnname3",R$"Columnname4"),20,4)
image(R)

works, while

R <- R[,1:4]
image(R)

doesn't.

 

That's okay if you don't have too many columns to work with. But right now I have a table with about 60 columns (with a promise of more) and inputting every one of them per hand would be pretty annoying.

Also the problem seems to be centered on image(). All other plotting functions I looked into don't have this problem.

Is there a workaround for this I'm not aware of? Or anything else I can do?

Have you tried to save the table and run the image()-function in R directly? Looks to me to be a problem in R rather than in KNIME.

Just use an R-snippet to call save(R, file = "some file location") and load this file into R with load(...) and run the image(R)-method.

One idea: the object "R" which comes from KNIME is a data.frame but image() might need a matrix. So I'm wondering what would happen if you convert R to a matrix before applying the function?

Antje

Thank you! I had forgoten about data.frames.

This not only sorts this out but also all the other instances where R didn't return any values.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.