Using an upload of test-data/2.tabular as test dataset My local installations (Mac and Linux) of galaxy reports this error for Histogram: An error occurred running this job: Error in hist.default(list(68, 71, 62, 75, 58, 60, 67, 68, 71, 69), xlab = "V1", : 'x' must be numeric This works without error at: http://main.g2.bx.psu.edu/ I looked at the code in tools/plotting/histogram.py and it doesn't make sense to me. Why does it create matrix = [] which it seems to use as a 2-Dim array? R hist() seems to only take an R Vector. Are there any version changes to R, Rpy, or NumPy that might have changed how this operates? I executed some of that code interactively and got the same error message: $ python Python 2.6.4 (r264:75706, Mar 9 2010, 10:00:44) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import sys from rpy import * matrix = [] vals = ["23","14","32","25","12","9","35","18","24"] for i in vals: ... row = [];row.append(float(i));matrix.append(row) ... matrix [[23.0], [14.0], [32.0], [25.0], [12.0], [9.0], [35.0], [18.0], [24.0]] a = array(matrix) r.pdf("histtest.pdf", 8, 8) title = "Histogram Test";xlab="Count";breaks="Sturges" r.hist( a, probability=True, main=title, xlab=xlab, breaks=breaks ) Traceback (most recent call last): File "<stdin>", line 1, in <module> rpy.RPy_RException: Error in hist.default(list(23, 14, 32, 25, 12, 9, 35, 18, 24), xlab = "Count", : 'x' must be numeric
a array([[ 23.], [ 14.], [ 32.], [ 25.], [ 12.], [ 9.], [ 35.], [ 18.], [ 24.]]) # Now JJ tries creating just a vector instead of using matrix ... v = [] for i in vals: ... v.append(float(i)) ... v [23.0, 14.0, 32.0, 25.0, 12.0, 9.0, 35.0, 18.0, 24.0] r.hist(v, probability=True, main=title, xlab=xlab, breaks=breaks ) {'density': [0.022222217777778667, 0.044444444444444446, 0.02222222222222223, 0.066666666666666666, 0.0, 0.044444444444444446], 'equidist': True, 'breaks': [5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0], 'intensities': [0.022222217777778667, 0.044444444444444446, 0.02222222222222223, 0.066666666666666666, 0.0, 0.044444444444444446], 'counts': [1, 2, 1, 3, 0, 2], 'xname': 'c(23, 14, 32, 25, 12, 9, 35, 18, 24)', 'mids': [7.5, 12.5, 17.5, 22.5, 27.5, 32.5]}
a = array(v) r.hist( a, probability=True, main=title, xlab=xlab, breaks=breaks ) {'density': [0.022222217777778667, 0.044444444444444446, 0.02222222222222223, 0.066666666666666666, 0.0, 0.044444444444444446], 'equidist': True, 'breaks': [5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0], 'intensities': [0.022222217777778667, 0.044444444444444446, 0.02222222222222223, 0.066666666666666666, 0.0, 0.044444444444444446], 'counts': [1, 2, 1, 3, 0, 2], 'xname': 'c(23, 14, 32, 25, 12, 9, 35, 18, 24)', 'mids': [7.5, 12.5, 17.5, 22.5, 27.5, 32.5]} r.dev_off() {'null device': 1}