Comments (19)
Oh... Then I'll have a look at this as soon as I can... Glad you found a working solution... Pls let me know if you observe unwanted side-effects!
from summarytools.
No side-effects observed! :)
from summarytools.
Congratulations! You solved the issue nicely!
I think the function works as a charm now :)
Hope there will be a new release/update of the package soon!
Cheers
from summarytools.
See this stackoverflow post for more...
from summarytools.
I have now looked further into it and found that the problem occurs due to this line: rownames(output)[i] <- paste0("Var",i).
If you replace this line with rownames(output)[i] <- paste0(colnames(x.df)[i]) the problem is solved!
What do you think?
from summarytools.
Actually no, this line is the "last resort" that applies only when previous attemps at recuperating rownames have failed.... So trying there again will not help... The names extraction is done in parse_args.R, and if the object is not visible in the Global environment, varnames are lost. So the challenge is to go look for it in the specific environment it is in.
from summarytools.
Ok!
But when I use: rownames(output)[i] <- paste0(colnames(x.df)[i]) in descr(), the names are desplayed, in my example data!
from summarytools.
It makes me realize I need to re-think the way attributes (in particular variable names) are retrieved. Things get complicated with with()
, by()
, and lapply()
in general, but for the colnames part, I see that I can simplify things (and make them work with shiny, too). A big thanks for your input on this @Payamdel !
from summarytools.
You are welcome!
Hope there will be a new release/update for "summarytools" available soon, including this fix!
from summarytools.
@dcomtois Could it be that the variable names are lost in Shiny due to the following codes in options.R ?
.st_env <- new.env(parent = emptyenv())
.st_env$tmpfiles <- c()
#Initialize list used by view() when printing an object of class "by"
.st_env$byInfo <- list()
from summarytools.
Hi... I'm still abroad on vacation but I'll look into it as soon as I can. Thx
from summarytools.
Ok I'm finally back... descr
should work fine now in Shiny Apps... Could you pls test it on your side? The fix is in the dev-current branch, so you'll need to install it:
devtools::install_github("dcomtois/summarytools", ref = "dev-current")
As for your question regarding .st_env, this seems to work fine with Shiny. It's the environment where the information on iterative processes (when using by
or lapply
) are stored in order for view
to output things neatly. Let me know if you observe problems in that area. Thx!
from summarytools.
So nice to here from you!
I have tried to install the package using the code you provided here (i.e. devtools::install_github("dcomtois/summarytools", ref = "dev-current"))
. But unfortunately, I get
"Installation failed: Command failed (255)"
Any idea?
from summarytools.
Hello!
Hmmm not sure why this happens. Can you install any other package with devtools::install_github? I saw that some people had problems with the unzipping, c.g.:
r-lib/devtools#1722
r-lib/devtools#638
from summarytools.
The problem with installation is solved by setting options(unzip = "internal")
before installing from github, as suggested by (r-lib/devtools#1722). So thanks for that!
Gonna test descr function and let you know how it works on my Shiny app!
from summarytools.
I need to report a related issues when it comes to the name of Group variable. More specifically, I found that the Name of Group variable does not change sometime even if I changed the group variable in the app. It should be noted that the table updates upon selection a new group variable. So the problem is related to the fact that the name of group variable dose not updates accordingly!
Would like to have look at this issue too?
from summarytools.
from summarytools.
Still happens. I have the latest installation and when I use a functions like:
getHtmlDescriptive <-function(iris){
st<-summarytools::descr(iris)
return(htmltools::renderTags(summarytools::view(st,method='render',omit.headings = TRUE))$html)
}
It perfoms ok, but if I do something like:
getHtmlDescriptive <-function(df){
st<-summarytools::descr(df)
return(htmltools::renderTags(summarytools::view(st,method='render',omit.headings = TRUE))$html)
}
it fails to retrieve var names.
testing with:
getHtmlDescriptive(iris)
from summarytools.
Could you try again after reinstalling from devtools::install_github("dcomtois/summarytools") pls? I pushed the changes from the dev-current branch, I think it should work now.
from summarytools.
Related Issues (20)
- Do not check grouped_df by callstack in ctable
- Specify how to order rows in a ctable()
- prettyNum error HOT 3
- Width of dfSummary output in html HOT 3
- printr package causes 2 graphs in dfSummary() rendered output
- dfSummary: histogram x-axis tick mark labels? HOT 1
- dfSummary: box plots for numeric variables? HOT 1
- Installing in Azure Synapse + SparkR: Error "fatal error: Magick++.h: No such file or directory compilation terminated." HOT 1
- Security: update jQuery to >=3.6.0 HOT 2
- Change of results when using tb() in grouped freq() HOT 3
- Bug in print generic implementation for list HOT 1
- [Feature request] dfSummary() with docx HOT 1
- UTF-8/odd character handling causes header headaches HOT 3
- Dependency on TCL/Tk breaks Docker/headless mode
- Group Index Does Not Print When Applying stby Through a Function on a List of Data Frames
- error when using dfSummary with shiny
- Fisher's exact test in ctable()?
- Getting incorrect results when using stby and descr with weights HOT 1
- Absolute max for dfSummary? Error when max.distinct.values>220
- Add n to summary statistics
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 summarytools.