[R] Points but no lines in qplot.

Hadley Wickham hadley at rice.edu
Thu Jun 30 16:21:46 CEST 2011


On Thu, Jun 30, 2011 at 7:31 AM, Ashim Kapoor <ashimkapoor at gmail.com> wrote:
> Dear R helpers,
>
> I have molten data which is : -
>
>> t3
>   Year       variable        value
> 1  2005     ICICI.Bank 274883700000
> 2  2006     ICICI.Bank 431668500000
> 3  2007     ICICI.Bank 595153000000
> 4  2008     ICICI.Bank 630857600000
> 5  2009     ICICI.Bank 545263300000
> 6  2005      HDFC.Bank   2658600000
> 7  2006      HDFC.Bank   7891000000
> 8  2007      HDFC.Bank  18031100000
> 9  2008      HDFC.Bank  27393400000
> 10 2009      HDFC.Bank  85769900000
> 11 2005            PNB           NA
> 12 2006            PNB           NA
> 13 2007            PNB  75137300000
> 14 2008            PNB 109035900000
> 15 2009            PNB 118837700000
> 16 2005            SBI 232442700000
> 17 2006            SBI 461432100000
> 18 2007            SBI 623252100000
> 19 2008            SBI 857680000000
> 20 2009            SBI 929450000000
> 21 2005      ICICI.HFC  23557565000
> 22 2006      ICICI.HFC  32154003000
> 23 2007      ICICI.HFC  37469402000
> 24 2008      ICICI.HFC  34675548000
> 25 2009      ICICI.HFC  54316755000
> 26 2005           HDFC 242590882274
> 27 2006           HDFC 302617792386
> 28 2007           HDFC 373624461430
> 29 2008           HDFC 483781358576
> 30 2009           HDFC 548894352646
> 31 2005        PNB.HFL   8052107836
> 32 2006        PNB.HFL   9466332836
> 33 2007        PNB.HFL  12193816630
> 34 2008        PNB.HFL  15604023235
> 35 2009        PNB.HFL  17056184555
> 36 2005          LICHF           NA
> 37 2006          LICHF           NA
> 38 2007          LICHF 170106489367
> 39 2008          LICHF 206187781841
> 40 2009          LICHF 252528694322
> 41 2005    Canara.Bank           NA
> 42 2006    Canara.Bank  67204000000
> 43 2007    Canara.Bank  67509700000
> 44 2008    Canara.Bank  66586000000
> 45 2009    Canara.Bank  77761100000
> 46 2005 Bank.of.Baroda  29717300000
> 47 2006 Bank.of.Baroda  38368000000
> 48 2007 Bank.of.Baroda  54146000000
> 49 2008 Bank.of.Baroda  67449000000
> 50 2009 Bank.of.Baroda  82761700000
> 51 2005      Axis.Bank  11278100000
> 52 2006      Axis.Bank  26086000000
> 53 2007      Axis.Bank  47635300000
> 54 2008      Axis.Bank  77796300000
> 55 2009      Axis.Bank 111004900000
>
> When I do
>
>  qplot(Year,value,data=t3,geom=c("point","line"),color=variable)
>
> I don't see a line for each level of variable. I see the colored points ,
> but no line joining them . Could someone be kind enough to tell me where I
> am wrong ?

Please supply a reproducible example:
https://github.com/hadley/devtools/wiki/Reproducibility

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



More information about the R-help mailing list