Comments (15)
@timelyportfolio This is not correct. I am using rpivotable in a large shiny project I'm working on and I use it exclusively with data.table. I'll check on table.
from rpivottable.
Well, it did not work on my end. I'll just make it explicit, so it will not be a problem.
from rpivottable.
@timelyportfolio Please try again: I just tested it now.
from rpivottable.
I believe it depends on the toJSON
that gets called and the data in the data.table
. Not sure why being explicit will cause a problem.
from rpivottable.
@timelyportfolio there is no toJSON in the actual code. I used in the example to quickly transform some of the json I got hacking a web example that Nicolas was using on Canadian election.
from rpivottable.
htmlwidgets
converts all parameters to JSON here . Since you don't believe me, try this:
rpivotTable(data.table(iris))
from rpivottable.
@timelyportfolio xtabs and table is different. But I am not sure it is a good idea to make the code too complex to manage these types. It is much better (and robust) to ask the user to convert.
Another story could be the new type tbl used by Hadley in dplyr, that he wants to design in compatibility with lap tools. I will ask him what are his plans and report back.
from rpivottable.
tbl_df
will work fine with my change. Can add a warning about conversion so user is not surprised.
from rpivottable.
@timelyportfolio since you do not believe me try this in dat01.R (in the example folder):
rpivotTable(data = as.data.table(jsdf_))
I will look into why iris does not work, but it certainly not because it is a data.table.
from rpivottable.
I never said your data did not work. What I said is that I have a case where an error occurs and that I think we should handle. See these type checks/conversions from RStudio.
https://github.com/rstudio/dygraphs/blob/master/R/dygraph.R#L31-L33
https://github.com/rstudio/DT/blob/master/R/datatables.R#L43-L53
from rpivottable.
@timelyportfolio the error with iris occurs because iris column names have a dot and I suspect pivotable does not like that. If you convert the dot in the colname into a _ (underscore) it works. Try it.
from rpivottable.
I think this is another expectation that gets solved with a simple conversion using data.table
built in conversion. toJSON
was not built with data.table
in mind so result will be more accurate with data.frame
.
I'll submit a pull and you can decide.
from rpivottable.
@timelyportfolio it seems that the problem is with the dot but this emerges only after a conversion from data.frame to data.table. (a data.frame with no dots in the colnames is OK and of course a native data.table is OK).
As I am a strong data.table supporter / user, I'll report it to the data.table project: if there is something that breaks the data.frame / data.table parallelism Matt D. and co. needs to have a look at it.
from rpivottable.
@timelyportfolio I think the issue is between RJSONIO and data.table. See here
from rpivottable.
Oh, I know it is. In no way should this discussion suggest that I do not support data.table
. I simply want rpivotTable
to be robust. Once data.table
is converted to JSON
it doesn't matter what form it is in. In fact, toJSON
will force convert unknown classes anyways. The step I added just assures that users get a good result.
from rpivottable.
Related Issues (20)
- Provide option to escape html HOT 3
- pivottable does not work with login/logout module HOT 7
- Using pivotTable from static html HOT 1
- factor levels order is not retained HOT 7
- aggregate name: identity HOT 7
- reduce area of metadata in output table HOT 3
- append style to rpivotTable css styles HOT 2
- Easier extendibility of rpivotTable() for custom S3 classes
- Support Excel Date Slice? HOT 1
- rpivotTable doesn't display anything HOT 1
- Question: Is there a way to sort table by values displayed in current column selection?
- My question is, How to colorize "Heatmap", creating a function with "ifelse ()"?????
- Plotting multiple rpivotTable with for loop in html r-markdown
- Compatibility with Bootstrap 4? HOT 1
- Top row missing (where remaining pivot variables sit)
- Drop down arrows problem with crosstalk v.1.1.1.
- rpivotTable is not working together with shinyjqui
- Drop down lists open in wrong position HOT 9
- Can't sort the Total column in the Pivot Table
- Sort rows in locale with characters not found in English
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpivottable.