High resolution R plots

Hi KNIME(R)s,

I want to have high resolution R plot on R view node of KNIME 3.1.1.

I try to execute following code:

knime.out <- knime.in

library(ggplot2)

df2 <- data.frame(knime.in$"CR",knime.in$"Raw",knime.in$"Group")

Group<-knime.in$"Group"

png("Plot.png", width = 4, height = 4, units = 'in', res = 300)

ggplot(df2,aes(knime.in$"CR", knime.in$"Raw", color=Group)) + 

  geom_point(alpha=0.33) +xlab("CR")+ylab("Raw")+

  theme(legend.position=c(0,1), legend.justification=c(0,1))

dev.off()

Here png is created however plot is not printed on it. 

What should I do?

Thank you very much in advance.

Canan

Hi again,

I found the solution for my question above. For ggplot, I should use following code to have a high resolution plot:

ggsave("Plot.png", dpi=300, limitsize=FALSE) instead creation of an empty high-res png and dev.off().

However, still, KNIME view doesn't display the plot. However, it is created on the location I gave.

How can I display the high-res plot on R view node?

Thanks again.

Canan

 

Hi Chas,

on the second tab "PNG Settings" of the R View dialog you can change the resolution of the output file.

Best, Iris

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