0

I am trying to plot this table with 2 y-axis since I have different values. I tried to use ggplot2 but was not so successful. Can someone help me? Is the ggplot the right package or you would suggest

It should look similar to this example that I found only but with 2 y-axis

enter image description here

This is my input data:

Variable    ID  Value
A   apple   1,2
A   banana  3,3
A   pear    1,1
A   strawberry  0,8
A   orange  5,7
A   kiwi    24,7
A   mango   14,2
B   apple   8,56
B   banana  5,5
B   pear    5,3
B   strawberry  8,81
B   orange  19,58
B   kiwi    34,21
B   mango   93,48
C   apple   87
C   banana  158
C   pear    113
C   strawberry  130
C   orange  155
C   kiwi    330
C   mango   433
D   apple   156
D   banana  141
D   pear    194
D   strawberry  164
D   orange  158
D   kiwi    158
D   mango   202

Any help is highly appreciated.

user20650
  • 24,654
  • 5
  • 56
  • 91
Maca
  • 9
  • It is possible with ggplot2, but it is a lot more work. Id suggest sticking to one of the options in the link ^^ – user20650 Nov 19 '16 at 21:02
  • [Here's Hadley's statement on why it's hard in ggplot2](http://stackoverflow.com/a/3101876/4497050); generally he thinks they're a bad idea. Since he wrote that, he/the ggplot2 team did add an exception for the particular case of different units, e.g. Fahrenheit and Celsius. – alistaire Nov 19 '16 at 21:09

0 Answers0