[R] Points but no lines in qplot.

Sarah Goslee sarah.goslee at gmail.com
Thu Jun 30 16:21:40 CEST 2011


Hi,

>
> I upgraded to the new R and tried R --vanilla but I still see no lines. In
> the legend,as earlier,I see a line through a point but in the graph I see
> only points. No lines. Any ideas now ?

Not a clue.

I even tried version of the data with t3 as character, and as a
factor, since that's a common tripping point, and qplot drew the lines
both times.

> library(ggplot2)
Loading required package: reshape
Loading required package: plyr

Attaching package: 'reshape'

The following object(s) are masked from 'package:plyr':

    round_any

Loading required package: grid
Loading required package: proto
> t3 <- read.table("clipboard", header=TRUE)
> str(t3)
'data.frame':	55 obs. of  3 variables:
 $ Year    : int  2005 2006 2007 2008 2009 2005 2006 2007 2008 2009 ...
 $ variable: Factor w/ 11 levels "Axis.Bank","Bank.of.Baroda",..: 6 6
6 6 6 5 5 5 5 5 ...
 $ value   : num  2.75e+11 4.32e+11 5.95e+11 6.31e+11 5.45e+11 ...
> qplot(Year,value,data=t3,geom=c("point","line"),color=variable)
Warning messages:
1: Removed 5 rows containing missing values (geom_point).
2: Removed 5 rows containing missing values (geom_path).
>
>
> t3.ver2 <- t3
> t3.ver2$variable <- as.character(t3.ver2$variable)
> str(t3.ver2)
'data.frame':	55 obs. of  3 variables:
 $ Year    : int  2005 2006 2007 2008 2009 2005 2006 2007 2008 2009 ...
 $ variable: chr  "ICICI.Bank" "ICICI.Bank" "ICICI.Bank" "ICICI.Bank" ...
 $ value   : num  2.75e+11 4.32e+11 5.95e+11 6.31e+11 5.45e+11 ...
> qplot(Year,value,data=t3.ver2,geom=c("point","line"),color=variable)
Warning messages:
1: Removed 5 rows containing missing values (geom_point).
2: Removed 5 rows containing missing values (geom_path).


>> sessionInfo()
> R version 2.13.0 (2011-04-13)
> Platform: i486-pc-linux-gnu (32-bit)

Did you intend to switch from 64-bit to 32-bit?

Sarah

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list