ggplot2 graphs are empty
1
0
Entering edit mode
7.3 years ago
friasoler ▴ 30

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 • 26k views
ADD COMMENT
1
Entering edit mode

Try rebooting your Rstudio

ADD REPLY
0
Entering edit mode

do you get any error messages?

ADD REPLY
0
Entering edit mode

no error messages.....

ADD REPLY
0
Entering edit mode

Are you working with RStudio or command line?

ADD REPLY
0
Entering edit mode

Thanks Wocka

I'm using RStudio

ADD REPLY
2
Entering edit mode
7.3 years ago

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).

ADD COMMENT
0
Entering edit mode

It worked!!! Thanks Giovanni

ADD REPLY
0
Entering edit mode

Hi Giovanni! Thanks for saving the day :)

ADD REPLY

Login before adding your answer.

Traffic: 1799 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6