Hello list I have this data frame which represent values grouped by algorithm. remark that for each algorithm, we have the same value in V3 but differnt values in V4. I want to make a plot with algorithms in axes, and for each algorithm I draw a bar (for V3) and a bwplot for V4. is thart possible. Thanks for any entry.> t[t[,2]<3,]V1 V2 V3 V4 1 HEFT-AC 1 402499.9 460543.4 2 HEFT-AC 2 402499.9 470316.8 31 HEFT-ACU 1 420814.2 433203.7 32 HEFT-ACU 2 420814.2 453475.8 60 LPT 1 402499.9 460543.4 61 LPT 2 402499.9 470316.8 90 SPT 1 453262.3 459070.3 91 SPT 2 453262.3 483893.6 119 MIN-MIN 1 447286.4 477632.5 120 MIN-MIN 2 447286.4 488146.3 149 MAX-MIN 1 457122.6 498265.2 150 MAX-MIN 2 457122.6 491143.3 -- *PhD in Computer ScienceAddress * *Avenue Taha Hussein Montfleury, 1008 Tunistél : +216 71 49 60 66 fax: +216 71 39 11 66* [[alternative HTML version deleted]]
Adel ESSAFI
2014-Jan-10 10:46 UTC
[R] Fwd: barchar and box on the same figure! is it possible
Hello list I have this data frame which represent values grouped by algorithm. remark that for each algorithm, we have the same value in V3 but differnt values in V4. I want to make a plot with algorithms in axes, and for each algorithm I draw a bar (for V3) and a bwplot for V4. is thart possible. Thanks for any entry.> t[t[,2]<3,]V1 V2 V3 V4 1 HEFT-AC 1 402499.9 460543.4 2 HEFT-AC 2 402499.9 470316.8 31 HEFT-ACU 1 420814.2 433203.7 32 HEFT-ACU 2 420814.2 453475.8 60 LPT 1 402499.9 460543.4 61 LPT 2 402499.9 470316.8 90 SPT 1 453262.3 459070.3 91 SPT 2 453262.3 483893.6 119 MIN-MIN 1 447286.4 477632.5 120 MIN-MIN 2 447286.4 488146.3 149 MAX-MIN 1 457122.6 498265.2 150 MAX-MIN 2 457122.6 491143.3 -- *PhD in Computer ScienceAddress * *Avenue Taha Hussein Montfleury, 1008 Tunis tél : +216 71 49 60 66 <%2B216%2071%2049%2060%2066> fax: +216 71 39 11 66 <%2B216%2071%2039%2011%2066>* -- PhD candidate in Computer Science Address 3 avenue lamine, cité ezzahra, Sousse 4000 Tunisia tel: +216 97 246 706 (+33640302046 jusqu'au 15/6) fax: +216 71 391 166 [[alternative HTML version deleted]]
Jim Lemon
2014-Jan-10 11:16 UTC
[R] Fwd: barchar and box on the same figure! is it possible
On 01/10/2014 09:46 PM, Adel ESSAFI wrote:> Hello list > > I have this data frame which represent values grouped by algorithm. > remark that for each algorithm, we have the same value in V3 but differnt > values in V4. > I want to make a plot with algorithms in axes, and for each algorithm I > draw a bar (for V3) and a bwplot for V4. > is thart possible. > Thanks for any entry. > > > >> t[t[,2]<3,] > V1 V2 V3 V4 > 1 HEFT-AC 1 402499.9 460543.4 > 2 HEFT-AC 2 402499.9 470316.8 > 31 HEFT-ACU 1 420814.2 433203.7 > 32 HEFT-ACU 2 420814.2 453475.8 > 60 LPT 1 402499.9 460543.4 > 61 LPT 2 402499.9 470316.8 > 90 SPT 1 453262.3 459070.3 > 91 SPT 2 453262.3 483893.6 > 119 MIN-MIN 1 447286.4 477632.5 > 120 MIN-MIN 2 447286.4 488146.3 > 149 MAX-MIN 1 457122.6 498265.2 > 150 MAX-MIN 2 457122.6 491143.3 >Hi Adel, Try this. I have used barp in plotrix as your algorithm labels need staggering. aedf<-read.table(text="V1 V2 V3 V4 HEFT-AC 1 402499.9 460543.4 HEFT-AC 2 402499.9 470316.8 HEFT-ACU 1 420814.2 433203.7 HEFT-ACU 2 420814.2 453475.8 LPT 1 402499.9 460543.4 LPT 2 402499.9 470316.8 SPT 1 453262.3 459070.3 SPT 2 453262.3 483893.6 MIN-MIN 1 447286.4 477632.5 MIN-MIN 2 447286.4 488146.3 MAX-MIN 1 457122.6 498265.2 MAX-MIN 2 457122.6 491143.3", header=TRUE) library(plotrix) barp(aedf$V3[!duplicated(aedf$V1)],ylim=c(0,600000), names.arg=unique(aedf$V1),staxx=TRUE) boxat<-1 for(alg in unique(aedf$V1)) { boxplot(aedf$V4[aedf$V1==alg],range=0,at=boxat,add=TRUE) boxat<-boxat+1 } Jim