[R] One graph for each row

Jim Lemon jim at bitwrit.com.au
Fri Jun 18 13:58:21 CEST 2010


On 06/17/2010 11:14 PM, Markus Kohler wrote:
>   Hi all,
> I have the following data (from a performance test)
> URL;time;Nr. of Users
> url1;0.101;1
> url10;0.048;1
>
> url2;0.097;10
> url2;0.066;10
>
> url3;0.915;30
> url3;0.847;30
>
>
> I want to have one plot for each url (times for 1,10,30 user),
> contained in *one* graph( one below each other).
>
Hi Markus,
This may not be the easiest way (or maybe not what you want), but:

mk<-read.table("mk.dat",header=TRUE,sep=";")
plot(mk$nusers[c(1,3,5)],mk$time[c(1,3,5)],type="l",
  main="URL time plot",xaxt="n",xlab="Number of users",
  ylab="Time (sec)",ylim=c(0,1))
lines(mk$nusers[c(2,4,6)],mk$time[c(2,4,6)])
axis(1,at=c(1,10,30))
require(plotrix)
boxed.labels(mk$nusers,mk$time,mk$URL)

Jim



More information about the R-help mailing list