Re: [R] graphical behavior of a table of numbers

2017-01-28 Thread Jim Lemon
Hi Richard, I think there may be something amiss in the plot.table function. As you note, changing the class of fr to array produces a more sensible plot, as does Bert's "as.vector". Yet inside plot.table we find: plot(x0, unclass(x), ... and that should produce an array: class(unclass(fr)) [1]

Re: [R] graphical behavior of a table of numbers

2017-01-28 Thread Bert Gunter
Rich: Simpler: Just lose the "table" class. plot(as.numeric(names(fr)), as.vector(fr), type="h", xlab="Determinant", ylab="Frequency") However, I'm no less puzzled by the "strange" behavior than you. In addition, it's probably worth noting that xyplot in lattice (and no doubt ggpl

[R] graphical behavior of a table of numbers

2017-01-28 Thread Richard M. Heiberger
## This example is from R-intro.pdf page 21 (R-3.3.2) d <- outer(0:9, 0:9) fr <- table(outer(d, d, "-")) plot(as.numeric(names(fr)), fr, type="h", xlab="Determinant", ylab="Frequency") ## The y-axis tick marks are at c(-21,24,65). ## This seems to be because class(fr) == "table" ## Sw

Re: [R] proportional odds logistic regression with non-negative constraint for several coefficients

2017-01-28 Thread Rune Haubo
Hi Zhao, This is not a direct answer to your question, but a suggestion for a different approach. The ordinal package was designed to cope with issues like this (parameter constraints in ordinal regression models) - try the following: > library(ordinal) > data(wine, package="ordinal") > ## Fit mo