Re: [Rd] [R] error in plot(table(c('a','a')))

From: Ludo Pagie <ludo.pagie_at_gmail.com>
Date: Wed, 28 Nov 2012 15:40:20 +0100

I already did, this morning; Bug 15118. I simply copied my original posting + refs to current discussion.

On Wed, Nov 28, 2012 at 3:22 PM, R. Michael Weylandt < michael.weylandt_at_gmail.com> wrote:

> Should I file an issue for this in the bug tracker?
>
> Slighly rearranged discussion with reproducible example follows on below.
>
> > Em 26-11-2012 21:39, R. Michael Weylandt escreveu:
> >>
> >> On Mon, Nov 26, 2012 at 2:41 PM, Ludo Pagie <l.pagie_at_nki.nl> wrote:
> >>> tbl.char1 <- table(c('a','a'))
> >>> tbl.char2 <- table(c('a','a','b'))
> >>> tbl.int1 <- table(c(1,1))
> >>>
> >>> # error:
> >>> plot(tbl.char1)
> >>>
> >>> # no errors:
> >>> plot(tbl.char2)
> >>> plot(tbl.int1)
> >>>
> >> Confirmed in current R-devel. It seems to arise from plot.table's use
> >> of seq.int(x) when the dimnames of the table are not integers. I'm not
> >> sure if this shouldn't be seq_along(x) instead, but I'm not sure I
> >> totally follow the internal logic, so perhaps someone can offer second
> >> opinion?
>
> On Mon, Nov 26, 2012 at 11:34 PM, Rui Barradas <ruipbarradas_at_sapo.pt>
> wrote:
> > I'd change "when the dimnames of the table are not integers "
> > to not numeric as that's what the code for plot.table tests. And it
> > seems to come from seq.int, since with table value
> > of 2, seq.int produces a vector of length 2 but the table length is 1:
> >
> > seq_along seems to solve the matter.
>

        [[alternative HTML version deleted]]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 29 Nov 2012 - 00:17:47 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 29 Nov 2012 - 02:31:37 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive