Giter Site home page Giter Site logo

Comments (21)

elinw avatar elinw commented on August 17, 2024

Are you on Windows and did you read the instructions for Windows in the readme file?

from skimr.

OmaymaS avatar OmaymaS commented on August 17, 2024

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.

elinw avatar elinw commented on August 17, 2024

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.

OmaymaS avatar OmaymaS commented on August 17, 2024

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.

elinw avatar elinw commented on August 17, 2024

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.

elinw avatar elinw commented on August 17, 2024

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.

elinw avatar elinw commented on August 17, 2024

@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.

screen shot 2017-09-13 at 5 32 15 pm

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.

elinw avatar elinw commented on August 17, 2024

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.

screen shot 2017-09-14 at 10 51 20 am

from skimr.

OmaymaS avatar OmaymaS commented on August 17, 2024

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.

elinw avatar elinw commented on August 17, 2024

@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.

koliajaykr avatar koliajaykr commented on August 17, 2024

@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.

screenshot from 2017-12-03 09-49-58

from skimr.

elinw avatar elinw commented on August 17, 2024

from skimr.

koliajaykr avatar koliajaykr commented on August 17, 2024

Thank you @elinw :)

from skimr.

koliajaykr avatar koliajaykr commented on August 17, 2024

@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.

elinw avatar elinw commented on August 17, 2024

from skimr.

koliajaykr avatar koliajaykr commented on August 17, 2024

@elinw , but I know exactly zero about pull request and how to contribute in it. :-(

from skimr.

elinw avatar elinw commented on August 17, 2024

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.

koliajaykr avatar koliajaykr commented on August 17, 2024

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.

elinw avatar elinw commented on August 17, 2024

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.

koliajaykr avatar koliajaykr commented on August 17, 2024

Sure, you are right.

from skimr.

elinw avatar elinw commented on August 17, 2024

#209 Please test the develop branch if you can, it should resolve the Windows-histogram issue.

from skimr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.