I would like to use a string as argument of a function in order to use this string for the plotting of the result, but R plots the argument variable name instead of its string value.
I tried different solutions (diparse, as.character...) but still no solution. Do you have any idea?

mcnemar_test &lt;- function (c1,c2,class1, class2)
{
    name1=label(class1)
    name2=deparse(substitute(class2))

    v1 = c1$encerts
    v2 = c2$encerts

    e00 = sum(ifelse(v1+v2==0,1,0)) #bad classification for both
    e01 = sum(ifelse(v1&lt;v2,1,0)) #bad classification for 1
    e10 = sum(ifelse(v1&gt;v2,1,0)) #bad classification for 2
    e11 = sum(ifelse(v1+v2==2,1,0)) #good classification for both

    matriu &lt;- matrix(c(e00,e01,e10,e11),nrow = 2, 
        dimnames = list(name1 = c("Disapprove", "Approve"),
                       name2 = c("Disapprove", "Approve")))
    print (matriu)
    t &lt;- mcnemar.test(matriu)
    return (t)
}
mcnemar_test(classifiers.NaiveBayes,classifiers.CART,"aa","bb")


I would like to see "aa" and "bb" but see "name1 and name2


Question: Can I use a shock pump to inflate a tube?
Answer: Note: this calculation makes many assumptions, so it's only useful in an 'average use case', not some sort of exact measurement. If you find better information, please post it and I'll update the answer.

How many pumps you would need to fill up a tire depends on many variables. First, the volume of your inner tube, which can be approximated as a torus (doughnut-shape) atop the rim size of a given diameter. You can find yours approximated on this graph.


26" Mountain Bike, 2.1" tire width = 4.8L
29" Mountain Bike, 2.1" tire width = 5.2L
700C Road Bike, 35mm tire width = 2L
20" BMX Bike, 1.85" tire width = 3L


I'm finding pump specifications quite difficult to find (I need piston diameter and stroke length), but here's a comparison of some shock pumps on an empty shock cylinder of a 2007 Fox 36 RLC 160mm Fork.


Average Accu-Gage Pressure Reading after 100 strokes: 77.2 psi
My best guess at RC2 air chamber specifications: 1" (25.4mm) diameter, 160mm length (max travel). If someone can find accurate specs or the true volume, I'd appreciate it.
Fox RC2 Air Volume (estimated): Vcylinder = pi*r^2*h = 81 mL


So then, IF pumping air into different volumes is linearly proportional (it's not, but somewhere in the ball park), and you wanted to inflate the tires listed above to ~77.2psi, it'd take about this number of pumps with the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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
20" BMX Bike, 1.85" tire width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3L&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;37:1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3,700&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

So, perhaps if it was a life or death situation, you have a lot of time on your hands, or you just can't afford that gym membership, you might want to pump a few thousand times to fill your tire. You probably don't.

By contrast, if you're just looking for this functionality in one device, you could just use a dual purpose model, such as this Specialized Pump, that can inflate both high pressure, low volume containers (like your shock) and low pressure, high volume containers (like your tire).



You twist the handle to select between uses, and save yourself a few thousand pumps.