kable_styling() weird interaction with dark RStudio themes - r

I recently started using Rmarkdown for my R coding, and I found it extremely useful. However, I have the following issue:
When I want to show tables behind the code (not in the output, but on the rmarkdown code itself), and I use the option kable_styling() from kableExtra package to display a table, if I have a dark theme activated (ie. Tomorrow Night Bright), the table apperas with a white shadow that makes it hard to read (see picture below):
However, this does not happen when I use a light theme (see picture below):
Does anyone know why this happens or how could I fix it? I have already tried to change the output format and a bunch of stuff. If I remove the kable_styling() option the table is correctly displayed, but not the way I want it to be formatted.
Thanks in advance and sorry if I wasn´t clear when posting the question, it is the first time I do this.

Related

Clear the current output from entire RMarkdown (Rmd) document in RStudio?

Especially when working with long RMarkdowns (e.g. 2-3000+ lines), it is desirable to completely clear all rendering and output (i.e. to get back to the same state as though none of the code in the RMarkdown had ever been executed), except without necessarily clearing the environment.
Is there a way to do this?
Note: in case someone wonders why, here are a couple of reasons:
occasionally (especially with javascript-heavy renderings, e.g. plotly, wordcloud etc) there can occasionally be bugs which not only affect the rendering that contains the bug, but all other renderings in the document, and
particularly in long Rmd files, it is sometimes simply easier to scroll through a doc which hasn't got renderings in it.
Click on the gear icon to the right of the "Knit" button at the top of your R Studio dashboard.
The very last option is "Clear All Output".
This should be what you are looking for.

Barlow rendering difference between Google Fonts example page and usage in a separate page

We're using Barlow, available for free from Google fonts, in a web app. Here's the way a sample phrase looks when rendered on Google's example page. (If you want to reproduce it, you will need to enter the custom text yourself and adjust the slider to 14px.)
Note, in particular, the distinct space between the bottom of the i and its dot above, as well as the clarity of the top part of the f.
This is how the same phrase looks when rendered in our app, as reproduced in this Code Pen.
Note the muddy space between the i and its dot, as well as the muddy top curve to the f.
I've tried looking through all the styles on the elements in question, and I can't find any style that should affect these differently. The network tab clearly shows that the bold version of the font is being loaded; it doesn't look as if this could be faux bold.
This may seem trivial, but we've actually had quite a few complaints about how the font looks in our app, specifically that the bold, lowercase i looks like an l.
Anyone have an idea what might be happening here?
Update: Using Chrome on a Mac; I can confirm the same issue in Firefox. This is on an external display... on a retina there's no problem, as there is way more detail.
The problem turned out to be a problem with the source repo: "hinting got missed in the most recent commit" and the Google specimen (which looked correct) was "actually running an earlier version."
Happily, the maintainer was able to get the problem fixed with a subsequent version.

R Leaflet does not show legend when embedded in Shiny Dashboard

The map above renders perfectly fine in the following scenarios:
List item
RStudio Viewer
Shiny app
Shiny app using a minimal Shiny dashboard sceleton
When including the map in an existing, pretty complex Shiny dashboard, the looks as follows:
Obviously, the legend is missing. On top of that, the "reset view" action button has no effect.
Without posting the complete code of the complex shiny dashbboard, I would like make the following comments:
I have disabled all custom JS code and CSS
I use a bare "renderLeaflet" function without additional arguments
I have also tried to display the leaflet in a bare dashboard box without any further arguments
Any obvious culprit anyone could think of causing this issue? Anyone observed similar issues?
I wonder if you solved the issue. I noticed the legend of a raster layer disappears when using the function d3heatmap, for instance d3heatmap(mtcars, scale="column", colors="Blues"). When the line with the heatmap is commented out the dashboard knites just fine -even when the library d3heatmap is loaded. I used the code from this example. Oh I just noticed this has been addressed and solved in other questions, for example here.

Switch from terminal style output to clickable output in Rmarkdown

I don't know the names for these things so I will attatche an image. Bassically I am used to being able to click through a dataframe inline on Rmarkdown. I just installed a freash version of R and Rstudio on my machine and the output looks like console output and it is not clickable. How do I change this?
This is what I would like
Note the ability to "thumb-through" the data by clicking "Previous" and "Next".
Thanks to #camille explanation, I tracked down the issue. It's a known bug in R v3.5 and an issue has been opened on github:
https://github.com/rstudio/rmarkdown/issues/1331

Altering The Sorting Arrows In an R Shiny tabPanel

I didn't see anything here or in http://shiny.rstudio.com/reference/shiny that seems to hit on this problem.
In an R Shiny tabPanel output, the sorting arrows align with the right side of the search fields at the bottom of the page.
Here's a pretty good example:
http://shiny.rstudio.com/gallery/datatables-options.html
Is there a way to make them align just to the right of the column name text up top?
Alternatively (or possibly both), is there a way to change the color of the arrows?
The default greyish doesn't really stand out. Bonus points to make the up and down arrows different colors.
Doing it directly in RShiny is best, but I could muddle my way through .js or .css if needed.
I'm trying to head off imminent support requests of "the column is sorting wrong" and "I can't see the arrows" before I push into production.
At the bottom of that shiny example you showed they show that you can pass in through the options parameter options to the rendering for the DataTable table, via the shiny::renderDataTable() function.
Hopefully the http://datatables.net/ site has documentation on what you want if it's indeed possible
If you look at Developer Tools on the http://shiny.rstudio.com/gallery/datatables-options.html page maybe you can see what element would need to be changed.

Resources