Comments (21)
Are you on Windows and did you read the instructions for Windows in the readme file?
from skimr.
Yes I am on windows, I read the instructions, that's why I used Sys.setlocale("LC_CTYPE", "Chinese")
The point is, I see the spark histogram shown properly on the when I run the chunk in .Rmd file or when I View() the dataframe. But when I knit the file, the html/md show symbols.
Also on the console:
library(tidyverse)
library(skimr)
Sys.setlocale("LC_CTYPE", "Chinese")
> dat <- skim(storms) %>% filter(stat=="hist")
> dat
# A tibble: 10 x 5
var type stat level value
<chr> <chr> <chr> <chr> <dbl>
1 year numeric hist ¨z¨z¨z¨}¨~¨}¨~¨~¨~¨} 0
2 month numeric hist ¨x¨x¨x¨x¨x¨y¨|¨~¨z¨x 0
3 day integer hist ¨~¨}¨}¨}¨}¨}¨}¨}¨}¨} 0
4 hour numeric hist ¨~¨x¨~¨x¨x¨~¨x¨~¨x¨x 0
5 lat numeric hist ¨y¨~¨~¨}¨~¨~¨|¨y¨x¨x 0
6 long numeric hist ¨x¨|¨~¨~¨~¨}¨}¨z¨x¨x 0
7 wind integer hist ¨y¨~¨|¨z¨y¨y¨x¨x¨x¨x 0
8 pressure integer hist ¨x¨x¨x¨x¨x¨x¨y¨z¨~¨y 0
9 ts_diameter numeric hist ¨~¨~¨|¨y¨x¨x¨x¨x¨x¨x 0
10 hu_diameter numeric hist ¨~¨x¨x¨x¨x¨x¨x¨x¨x¨x 0
> dat$level[1]
[1] "▃▃▃▆▇▆▇▇▇▆"
from skimr.
Is this when knitting to PDF? I'll say that right now for me that is not working for hist at all (html is fine). In fact it stops processing. However adding latex_engine: xelatex to the YAML at least gets it to run. http://rmarkdown.rstudio.com/pdf_document_format.html#advanced_customization.
When did you install? Was it since this morning? There were changes made to the dependency that manages those, which I guess could have an impact.
from skimr.
It happens with both, knitting to html as well pdf. I am more interested in the html now.
And I have installed it this week or 2 weeks ago, definitely before this morning.
from skimr.
Before I changed the latex engine pdf was dying. Now it knits but blank for both line_graph and hist. Html is working. I'm on a mac. I'll have to try to look into this but I suspect it might have to do with the character sets. I'm also going to see if pillar (formerly colformat) has this same issue outside of skimr.
from skimr.
I think the issue is that you need a font that supports the building block drawing characters an for braille. It seems like DejaVu would be the free one that is most commonly used. However, while I have figured out how to change the font of the text I haven't figured out how to get the <pre>
regions to accept a new font. Also I haven't figured out how to access DejaVu.
from skimr.
@OmaymaS
Okay here is an update. The important thing, as described in the pillar readme file, is that you have a font installed that has block building characters. There are a number of these one of which is Dejavu Sans.
For my mac I used homebrew.
brew tap caskroom/fonts
brew cask install font-dejavu-sans
Later I found the extrafont package which includes several of the dejavu fonts.
At the top of my rmd file I changed my YAML to reference the font.
---
title: "Untitled"
output:
pdf_document:
latex_engine: xelatex
html_document: default
font-family: "DejaVu Sans"
mainfont: "DejaVu Sans"
---
Remember that spaces matter in YAML so be careful.
HTML was working for me already and this continued fine. However now in PDF I still can't get the graphs embedded in the code chunk output that is formatted with <pre>
. However, unlike previously I can get the spark graphs inline as below.
So I would suggest trying the extrafont package. If that doesn't work for Windows you will need to figure out how to install a font that supports block building and also braille.
If you could try that and then report back that would be awesome. There are a number of places that explain how depending on your version etc.
We still need to figure out the issue for pre formatted sections in PDFs.
from skimr.
Okay, one more update ... the real answer for me is using results=asis
in the code chunk options and then using kable (or I assume something else) to format the table.
from skimr.
Thanks!
I could finally knit to html by using kable. I added examples here. However, if I don't use kable, the histograms do not appear properly. Will check it out, check the PDF and get back to you.
from skimr.
@OmaymaS did you ever have an update on this? Now we have pull requests to support kable and pander. Can I close this issue and we can open a new one for a branch including that support? I think we also need to document some things about fonts. i think we may need to suggest extrafonts.
from skimr.
@elinw
I'm sorry for late reply, PhD thesis writing torturing me. You are absolutely write about the types of font use and skimr summary output. For me, latex pdf bring histogram figure only with the fonts:
font-family: "DejaVu Sans"
mainfont: "DejaVu Sans"
, suggested by you. But the same file gives empty hist column if I use font:
mainfont: EB Garamond
I got this nice output with your present and earlier suggestions. Can you suggest something to remove the last 'value' column, it is full of zeros - seems not so important.
from skimr.
from skimr.
Thank you @elinw :)
from skimr.
@elinw , I've a suggestion, is it not possible to provide the no. of observations and variables information too at footnote of the descriptive table? Because when we produce table using kable and skim, the info about the number of variables and observations is lost, the way it comes when we use only skim()
from skimr.
from skimr.
@elinw , but I know exactly zero about pull request
and how to contribute in it. :-(
from skimr.
I looked at the code and in pander() and kable() there is the caption parameter, so we can definitely put the separate table text in there at least for now. And adding the header text the way we do for print is also easy so we can do it for now (but long run I'd like something better). Pull request coming soon.
from skimr.
Thank you @elinw :-)
Once, I'm done with my thesis. I'll make myself more friendly with the technicalities of GitHub, R packages and latex.
from skimr.
This is still an issue that we haven't solved. It's not clear if it is possible, but I'd rather at least have it showing as an issue so people know we are aware of it.
from skimr.
Sure, you are right.
from skimr.
#209 Please test the develop branch if you can, it should resolve the Windows-histogram issue.
from skimr.
Related Issues (20)
- Incorporate R 4.2 changes HOT 2
- Issues with 4.2 HOT 2
- Branch renaming
- Is there a way to get the plain text output in RMarkdown? HOT 5
- Better support RMarkdown notebook's interactive paged tables HOT 2
- print() with include_summary = F returns skimmed table twice HOT 2
- Deprecated usage of `vec_equal_na()` from {vctrs} HOT 9
- Change to new cran checks badge URL HOT 1
- Submit new version of skimr to CRAN soon? HOT 3
- Remove skips of tests on windows HOT 1
- Printing more rows than default max has unexpected behavior HOT 4
- Dots in in-line histogram HOT 6
- group_by not always working HOT 7
- Error when skimming `haven_labelled` variables HOT 7
- bespoke skim no longer working HOT 16
- Vignette issue
- Rename 'skim_variable' to 'variable'? HOT 3
- Force produce text in R markdown chunk
- Summarize character vectors like factors HOT 2
- Consider adding a default skimmer for large integers HOT 1
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 skimr.