0

I found an issue with the package rpivotTable, see an example blow:

>USD<-c(-14567,212091,-345678,456172)
>KNTD<-c(-231234,111323,-3145670,5012344)
>category<-c("A","B","C","D")
>item<-c("E","F","G","H")
>table<-data.frame(category, item, USD, KNTD)
>table
     category item     USD     KNTD
 1        A    E    -14567  -231234
 2        B    F    212091   111323
 3        C    G   -345678 -3145670
 4        D    H    456172  5012344
>rpivotTable(table)

The values are correct in the Table.(Picture1) Pic1

However, in picture 2, the value of A shows "-14,600." Pic2

in picture 3, the value of C shows "-346,000.", both A and C are not correct and they are negative values. I'm wondering if it's a bug or did I wrongly missed something. Thanks. Pic3

nicolaskruchten
  • 26,384
  • 8
  • 83
  • 101
Samoth
  • 716
  • 15
  • 34
  • Could it be a rounding problem? – akrun Aug 06 '16 at 02:21
  • @akrun: Maybe, but can you explain more? All of the values are integers. – Samoth Aug 06 '16 at 02:24
  • You may need to check the function code to see whether it does such sort of things. I don't have the package installed. Also, big integers may get converted to double and then the rounding happens. – akrun Aug 06 '16 at 02:27
  • @akrun: Thanks, and the rounding only happens on negative values. No rounding on positive values. – Samoth Aug 06 '16 at 02:42
  • 2
    Sorry for the long delay ;). I'm the creator of the package (on top of the marvellous work of the creator of pivottable.JS). Thanks for using rpivotTable. the problem you report appear like a c3 bug. I reported here https://github.com/nicolaskruchten/pivottable/issues/692 – Enzo Apr 19 '17 at 21:26
  • 1
    And I'm the creator of the underlying PivotTable.js library ... I've fixed the bug there so hopefully we can get the fix upstreamed soon :) – nicolaskruchten Aug 02 '17 at 14:05
  • Thanks, so there will be a new version release? – Samoth Aug 03 '17 at 02:23

0 Answers0