[R] Line plots with different symbols on the same line

Philippe Hupé Philippe.Hupe at curie.fr
Mon May 19 11:47:43 CEST 2003


Strecker, Stefan a écrit :

>Hello,
> 
>my data is an ordered list of observations where each observation is either of condition "efficient" (coded as 1) or "non-efficient" (0) as e.g.
> 
>No. Obs Condition
>1 1.1 0
>2 1.2 1
>3 1.4 1
>4 1.5 0
>5 2.5 1 
>etc.
> 
>My goal is to plot a single line with lty='o' but different symbols for either condition whenever condition is 1 or 0, i.e. on the x-axis the consecutive no. of observation is plotted with the obs on the y-axis as two different symbols (e.g. pch=1 and  pch=2). 
> 
>Is there any way to achieve this?
> 
>Thanks in advance
>Stefan
> 
> 
> 
> 
>
>	[[alternate HTML version deleted]]
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
>.
>
>  
>
plot(Obs, data=your_data_frame, pch=c("*","+")[as.factor(Condition)])
see pch for details of symbols available
hope this helps.

Philippe

-- 

--------------------------------------------------

Philippe Hupé
Institut Curie - Equipe Bioinformatique
26, rue d'Ulm - 75005 PARIS France
+33 (0)1 42 34 65 29

Philippe.Hupe at curie.fr <mailto:Philippe.Hupe at curie.fr>




More information about the R-help mailing list