Basic-Excel-R-Toolkit
Basic-Excel-R-Toolkit copied to clipboard
ggplot2 graphs work from R console/shell but the shape doesnt come in excel
ggplot2 does not work in excel. I have been trying to make this work for 2 days in a row continously Following is my function `library("reshape2"); library("tidyr") library("lazyeval") library("ggplot2")
plot_hist <- function(){ BERT.graphics.device(); asdf <- c(2,3,10,15,5,6,2,5); qplot(asdf, geom="histogram") #hist(asdf) }`
If I do hist(asdf), I get a histogram however if I do qplot(asdf,geom="histogram") there is no histogram in excel
I tried entering the same commands in console as follows:
asdf <- c(2,3,10,15,5,6,2,5); qplot(asdf, geom="histogram")
and it generates an histogram
I dont know where the issue is.
If it was BERT.graphics.device(), I would not get the hist(asdf). If it was ggplot, then the output in the console should have a problem
I tried various combinations like BERT.graphics.device(cell=T); dev.off(); T;
But no matter what I do, ggplot histogram does not populate into excel What am I doing wrong ? I tried uninstalling BERT, deleting BERT directory, restarting computer and reinstalling
I just managed to figure this out after trying over a very long period :)
I had to put output to a variable and print it, hence for example t <- qplot(asdf, geom="histogram") print(t);
Exactly what I have been struggling with, thanks a lot!!!
Thanks a lot! I was struggling with the same. If there are more people working on BERT, please contact me. Maybe there are something that we can learn together. Regards