[R] plot or boxplot!

Uwe Ligges ligges at statistik.uni-dortmund.de
Fri Sep 28 11:13:41 CEST 2007



Samuel Okoye wrote:
> Hello,
>    
>   if we suppose that
>    
>   times <- c("2006-05-14", "2006-06-12", "2006-06-12", "2006-05-14", "2006-05-14", "2006-06-12")
>   value <- c(2,3,1,4,3,1)
>    
>   then with
>    
>   plot(times, value)
>    
>   we have two boxplots in one graph for 2006-05-14 and 2006-06-12 respectively! Is it possible to have them in a scatterplot? and if I sort the data as
>    
>   x <- data.frame(times, value)
>   x <- x[order(times),]
>    
>   Is it possible to create a new variable which contains 1 for 2006-05-14 and 2 for 2006-06-12?


If you not also want to make it some time/date object, you can simply it 
a factor, hence type

times <- factor(times)

Uwe Ligges


>   Thank you very much in advance!
> 
> 
>        
> ---------------------------------
> Luggage? GPS? Comic books? 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list