This is a test version of Biostars. For the public version, visit https://www.biostars.org.
ggplot2 graphs are empty

I have troubles trying to use ggplot2 package. All the graphs I got are empty:

ggplot(data=dataa,aes(x=Description, y=RPKM,fill=Condition))+ geom_bar(position="dodge",stat="identity")

File dataa is a piece of a bigger data frame like this:

Description    Tissue    Condition    RPKM
re                  brain       obese       3
re                  brain       Slim         34
re                  brain       Fit           35
re1                brain       Fit            23
re1                brain       obese       34
re1                brain       Slim         67

Do you have any idea what I'm doing wrong?

r

do you get any error messages?

Are you working with RStudio or command line?

Thanks Wocka

I'm using RStudio

Try rebooting your Rstudio

1 answer

You are probably plotting to a null device. Try dev.new() to launch a new one. In alternative, if this code is inside a function, you will have to print it explicitly. For example: myplot<-ggplot(...) + geom_bar(); print(myplot).

Hi Giovanni! Thanks for saving the day :)

Log in to answer this question.