Comments (14)
Shiny support has not been tested. I hope to get to it over the weekend or next week. I think @smartinsightsfromdata has used in Shiny successfully but not sure if in a tabset.
from rpivottable.
The example shiny app works fine. I am using navbarPage and tabsets in my app so maybe there is something there.
from rpivottable.
@mostly-harmless I use rpivotTable with an app with navbarpage plus multi-tabs in page (just counted: 11 tab panels distributed in two rows and two tabsetpanels). With no issue whatsoever.
Can you share your code please?
from rpivottable.
@mostly-harmless This is the UI code:
fluidRow(br(),rpivotTable::rpivotTableOutput('demPivot') )
And this is the server code:
output$demPivot <- renderRpivotTable({
tbl <- model_
rpivotTable(data = tbl
,rows="activityname",cols="subfunctionname",
vals="activityunits", aggregatorName="Sum")
})
from rpivottable.
No luck on my end figuring this out yet. My code:
UI:
tabPanel("Pivot", rpivotTableOutput("pivotData"))
Server:
output$pivotData <- renderRpivotTable({ rpivotTable(data = r_data[[input$dataset]]) })
r_data is a reactiveValue object that has the data.
Just to verify it is not (likely) something on my end I replace the rpivotTable lines with the ones below. Those work fine.
tabPanel("Pivot", dataTableOutput("pivotDataTable")),
output$pivotDataTable <- renderDataTable({
r_data[[input$dataset]]
})
Not sure if the line from the js console might be useful:
Full code is at:
https://github.com/mostly-harmless/radiant/tree/shiny11
from rpivottable.
I made some progress isolating the source of the problem. My ui.R is built using renderUI. The call to rpivottable does not work when I put it in a renderui. However, if I put it directly into ui.R, which I assume is what you to @smartinsightsfromdata, it does works. The file where the tabs are created in my app is linked below in case that is helpful. Any suggestions?
https://github.com/mostly-harmless/radiant/blob/shiny11/inst/base/tools/data/data_ui_and_tabs.R
Note: The output from rpivottable is actually not being shown in Rstudio viewer. The output I was seeing was from an example @timelyportfolio sent me. Sorry for the confusion.
from rpivottable.
@mostly-harmless I don't know what to say: it worked for me without problems (nice work by the way, well done!).
On the other hand I had (many) problems with the libraries (but this is partly due to RRO - I'm used to it).
My sequence of ops was:
- build radiant-shiny11 in Rstudio (adding independently any package that was failing the build).
- Open in base ui.R and launch it. At least I've got proof with the screenshot!
- I wanted to re-try downloading rpivotTable form github (just in case), but when I re-entered into the Rstudio project radiant tried to re-install all the packages failing on some (again, probably due to RRO: I need to install lots of packages as source) and the application did not run. Now I will be busy installing packages from source for a while :)
from rpivottable.
@mostly-harmless on the other hand, looking at your folders, in www you have a jquery-ui.custom.min.js
library already. Assuming it is used by some other part of your code, in some instances the dom will have possibly two jquery-ui scripts, with bad consequences.
from rpivottable.
@mostly-harmless Steps tried:
- Re-published in github rpivotTable (to be certain that all was ok).
- Re-installed rpivotTable
- Open in rstudio radiant-shiny11 (I only made one change: I have commented out all of dependencies.R) because of problems with my RRO libraries)
- Build radiant package with rstudio
- Launched the shiny app (runApp button on rstudio): all OK
I repeated steps 3 to 5 (and just 5. of course) few times with positive results each time. I couldn't see any js error on the page.
Of course I haven't navigated every corner of the app (here on safari directly - screen zoomed out to show everything).
from rpivottable.
Thanks for looking into this Enzo. Very strange that this works on your machine and not at all on mine. Below is all I see in Chrome or Safari. Could you send me output from sessionInfo()
on your machine? What is RRO by the way?
sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] radiant_0.1.10 shinyAce_0.2.0 broom_0.3.5.9000 ggvis_0.4
[5] dplyr_0.4.1 tidyr_0.2.0 magrittr_1.5 shiny_0.11
[9] ggplot2_1.0.0 pryr_0.1 lubridate_1.3.3 testthat_0.9.1
[13] rpivotTable_0.1.2.6 rmarkdown_0.4.2 knitr_1.8 markdown_0.7.4
[17] reshape2_1.4.1 brew_1.0-6 AlgDesign_1.1-7.3 wordcloud_2.5
[21] RColorBrewer_1.1-2 vegan_2.2-1 lattice_0.20-29 permute_0.8-3
[25] psych_1.4.8.11 GPArotation_2014.11-1 gridExtra_0.9.1 car_2.0-22
loaded via a namespace (and not attached):
[1] assertthat_0.1 cluster_1.15.3 codetools_0.2-10 colorspace_1.2-4 DBI_0.3.1
[6] digest_0.6.8 evaluate_0.5.5 formatR_1.0 gtable_0.1.2 htmltools_0.2.6
[11] htmlwidgets_0.3.2 httpuv_1.3.2 MASS_7.3-37 Matrix_1.1-4 memoise_0.2.1
[16] mgcv_1.8-4 mime_0.2 munsell_0.4.2 nlme_3.1-119 nnet_7.3-8
[21] parallel_3.1.2 plyr_1.8.1 proto_0.3-10 R6_2.0.1 Rcpp_0.11.4
[26] RJSONIO_1.3-0 scales_0.2.4 slam_0.1-32 stringr_0.6.2 tools_3.1.2
[31] xtable_1.7-4 yaml_2.1.13
from rpivottable.
I reinstalled rpivotTable from gihtub and now it works. Same package version 0.1.2.6. I don't get it.
2 questions:
- It seems the order of factor levels is not maintained when pushed into the browser / pivottable.js.
- Is it possible to distinguish factors/character/etc. from numeric variables (e.g., using color)? Numerics are great for averages but, most likely, you wouldn't want them on the row/colum axes.
Anyway, thanks for all the great work on rpivotTable! It really is quite a slick application.
from rpivottable.
@mostly-harmless thanks you for using it. In reality I feel a bit of an usurper of fame: frankly all of the merit goes to Nicolas @nicolaskruchten that has developed the pivottable library. Ultimately this is just a wrapper.
I'm having some issue in ordering categorical variables too. As far as I understand pivottable works ordering alphabetically any variable except numbers. For example in my project I need to prefix months with 01-Jan etc. to have them ordered properly.
In reality you could do some formatting and a different sorting, but from what I saw from Nicolas' examples it is done through additional ad hoc scripting and changes / extension to the renderers. We are sort of limited by accessing to the widget using a single function call from R (let's not forget that pivottable is normally used as a widget in a javascript project where you have more latitude to do things ad hoc).
I personally prefer to keep things simple and easy to use. But rest assured that I'll keep an eye on any improvement to the original code and I'll try to pass onto R.
from rpivottable.
@mostly-harmless RRO is Revolution R Open. It is significantly faster thanks to intel MKL (on Linux and Windows - but accelerate on Mac) for linear algebra.
This is my session info - I'm on OS X yosemite:
sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_GB.UTF-8
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] radiant_0.1.10 shinyAce_0.2.1 broom_0.3.5.9000 ggvis_0.4
[5] dplyr_0.4.1 tidyr_0.2.0 magrittr_1.5 shiny_0.11
[9] ggplot2_1.0.0 pryr_0.1 lubridate_1.3.3 testthat_0.9.1
[13] rpivotTable_0.1.2.6 rmarkdown_0.5.1 knitr_1.9 markdown_0.7.4
[17] reshape2_1.4.1 brew_1.0-6 AlgDesign_1.1-7.3 wordcloud_2.5
[21] RColorBrewer_1.1-2 vegan_2.2-1 lattice_0.20-29 permute_0.8-3
[25] psych_1.5.1 GPArotation_2014.11-1 gridExtra_0.9.1 car_2.0-24
loaded via a namespace (and not attached):
[1] assertthat_0.1 cluster_2.0.1 codetools_0.2-10 colorspace_1.2-4 DBI_0.3.1
[6] digest_0.6.8 evaluate_0.5.5 formatR_1.0 gtable_0.1.2 htmltools_0.2.6
[11] htmlwidgets_0.3.2 httpuv_1.3.2 lazyeval_0.1.10 lme4_1.1-7 MASS_7.3-37
[16] Matrix_1.1-5 memoise_0.2.1 mgcv_1.8-4 mime_0.2 minqa_1.2.4
[21] mnormt_1.5-1 munsell_0.4.2 nlme_3.1-119 nloptr_1.0.4 nnet_7.3-8
[26] parallel_3.1.2 pbkrtest_0.4-2 plyr_1.8.1 proto_0.3-10 quantreg_5.11
[31] R6_2.0.1 Rcpp_0.11.4 RJSONIO_1.3-0 scales_0.2.4 slam_0.1-32
[36] SparseM_1.6 splines_3.1.2 stringr_0.6.2 tools_3.1.2 xtable_1.7-4
[41] yaml_2.1.13
from rpivottable.
The update to rpivotTable fixed things on my end. Thanks Enzo!
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.