In the link below you'll see the current example for cars with a certain drop-down styling. When I produce this same example I get a different style where the drop down boxes extend the width of the content area. Is there something I need to add to my Rmd to use the style on the website instead?
http://rawgit.com/jimhester/knitrBootstrap/master/vignettes/two-D.html
You need to use the github version of the knitrBootstrap package in order to use buttons rather than panels. The CRAN version of the package only has panels. The easiest way to install the package from github is with devtools.
install.packages(devtools)
library(devtools)
install.packages('jimhester/knitrBootstrap')
library(knitrBootstrap)
Also note the github version of knitrBootstrap uses the new rmarkdown package, so you generate the report using the rmarkdown::render function.
The default is collapse type in the new version is buttons, but you can specify using panels to toggle with the chunk option bootstrap.panel.\
See https://github.com/jimhester/knitrBootstrap for more details on using the new package and all the options available.
I unfortunately cannot release the current code to CRAN until the rmarkdown package is also released to CRAN, so in the meantime this is the only way to get the new features.
Related
I create powerpoint files using the R package Officer. I would like to make the files accessible by adding alt-text to each slide, and ideally to different parts of each slide. I know how to add alt-text using Rmarkdown when creating word documents, etc. but don't know if it is possible with Officer. I would like to use the Officer package because of the control it provides in placing content, etc.
Is it possible to add alt-text with Officer?
I'm working with R, in RStudio, and I use to specify the package of each function in my scripts, even if the package is already loaded in the environment. I want to be sure that the code will use the filter() function from dplyr, and not from another package which has a similar named function.
For instance :
Question/ to make code easier to read, is there a way to play with global appearance colors, and that package names (all names before ::) are in a different color (light grey for instance) ?
Here is a complete answer, I guess will work.
Since a recent version of rstudio, you can add custom themes on rstudio (see this update blog)
From this point you can create custom themes, but it require you to know the "code" for each part of your script. After opening the inspector, I've foudn that the dplyr word before the :: is named as support. See the color used in the theme Cobalt here (custom theme editor).
Finally, once you created your own theme by modification of a previous one (creating from scratch is always a pain), you import it in rstudio (see in the first link) and apply it.
At this point you won't see any change, because you also need to check Global options > Code > Diplay > highlight R function call. This will highlight the word classified as support and as support.function. You can set both colors in the theme editor (Cobalt theme has the first one in light green and the second one in light orange).
I've not done the full process myself but I think it could work.
You can modify themes at this website: https://tmtheme-editor.herokuapp.com/#!/editor/local/Monokai
If you go to Customize Preview Code at the bottom right, you can test out the code in your image above.
If you change the color for variable, it seems like this makes the change you're looking for.
When you've customized everything to your liking, you can download your custom theme. Then you can go back to Rstudio --> Tools --> Global Options --> Appearance, and click 'Add' to add your theme.
When I disable the prettier-atom package, the tab size is 4, but when I enable the prettier package, formatting a file causes the tab size to decrease to 2. My prettier version is 0.56.4; I was able to directly modify the tab size of prettier in my prettier package settings on a previous version, but now the option is gone. I've looked at other questions about tab size, but haven't found where to directly edit the prettier default tab size.
Any help or direction is appreciated. :)
Unfortunately, the tab length in the latest prettier-atom package is 2 and there is no way to change it.
The atom-beautify package https://atom.io/packages/atom-beautify uses the standard Tab Length from your Atom settings.
I create a R Markdown file in RStudio , then I click on the Knit HTML button on the top of the screen to create and save an HTML page which I want to use elsewhere, say store it on my server.
The problem with the HTML file, is that it contains
<script type="text/javascript" src="https://c328740.ssl.cf1.rackcdn.com/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
which is not valid anymore, and when I edit the HTML and change the source to the following it works.
https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
Any way I don't have to edit every time the HTML, but have the correct source from RStudio?
This was changed in the rmarkdown package just about a month ago (see this commit). You just need to install the latest version of the rmarkdown package:
> devtools::install_github("rstudio/rmarkdown")
(of course, you'll also need to install.packages("devtools") if you don't have devtools.)
Incidentally, even without this step, you can tell rmarkdown where you want to get MathJax from. This is useful if you want to point to a different CDN.
output:
html_document:
mathjax: https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
Finally, you can eliminate your MathJax CDN dependency entirely by using mathjax: local to use a built-in copy of MathJax in rmarkdown (note that you'll also need to set self_contained: no to do this).
Is it possible to change the default zoom level when using knitRBootstrap?
I know in my knitRbootstrap settings I can change the thumbnail size, but that doesn't allow a lot of flexibility as there is a max value:
knit_bootstrap_md(input=inputFile, output=outputFile, boot_style = 'cerulean',
code_style="Google Code",
chooser=NULL, thumbsize = 9, show_code=FALSE)
I like the features of knitRbootsrap and prefer it over conventional knitR, but not sure the easiest way to customize image size to allow for certain plots/charts to appear larger
The current github version of knitrBootstrap has a chunk option for the image thumbnail size with bootstrap.thumbnail.size. They correspond to the bootstrap grid options, the default is col-md-6.
The new version is not yet available on CRAN, but you can install it easily with devtools.
install.packages('devtools')
library(devtools)
install_github('jimhester/knitrBootstrap')
Please see the knitrBootstrap github page for full details on all the options and using the new version.