Bye, RStudio/Posit!
Yihui's Blog | R statistics
by
3M ago
Who is down? Me. After more than 10 years at RStudio/Posit, the time has come for me to explore other opportunities. A little over two weeks ago, I was told that I was laid off and my last day would be 2023-12-31. Frankly speaking, I was quite surprised but only for a short moment. I fully respected Posit’s decision, and quickly accepted the conclusion that my contribution no longer deserved a full-time job here. The end of a relationship often does not imply anything wrong or a failure of either party. Instead, it can simply indicate a mismatch, which is normal. People just change. With these ..read more
Visit website
Making SearchBuilder Work in the Server Mode in DT (Help Needed)
Yihui's Blog | R statistics
by
5M ago
Three years ago, Xianying Tan helped me add the SearchBuilder extension of DataTables to the DT package. This extension did not exist when I first started developing DT, otherwise I would not have spent countless hours on creating a variety of filters in DT by myself and make them work in both the client and server modes. This extension is much, much more flexible than my clumsy “homemade” filters. Yes, SearchBuilder has been made available to DT three years ago, but the problem is that it only works on the client side. That is, if you render a table in Shiny, you cannot DT::renderDT(server ..read more
Visit website
An Upcoming Change in the TinyTeX Installation Path on Windows
Yihui's Blog | R statistics
by
5M ago
Since about a month ago, I have been receiving error reports from TinyTeX users saying “TinyTeX\bin\windows\runscript.tlu:864: no appropriate script or program found: fmtutil” or “I can't find the format file `pdflatex.fmt'!”, which I do not understand. For the last few days, I scratched my head, banged against the wall, did some research, asked R and LaTeX experts in mailing lists, got reminded of “[[alternative HTML version deleted]]” again (and apologized, of course), dug out an old Windows laptop, proudly created a new user account with my authentic Chinese name for the first time of my li ..read more
Visit website
Convert Definition Lists (``) to Frames (``)
Yihui's Blog | R statistics
by
5M ago
When I suggested a department chair in 2019 that they may consider opening a blog so that all students and faculty in the department can write together (which sounded exciting to me), he expressed a concern that some readers might remember authors’ mistakes in the posts. Considering the reputation of the whole department, that is a valid concern. However, to err is human (and to forgive is divine). Everyone makes mistakes. I often update my old posts to correct mistakes or write a note saying certain information is oudated after a few years. My notes did not have a formal form. Sometimes a not ..read more
Visit website
R Markdown v1: Feature Complete!
Yihui's Blog | R statistics
by
6M ago
When we say “R Markdown”, we usually refer to the rmarkdown package, which is based on Pandoc and knitr. Prior to the rmarkdown package, there actually existed an older version of R Markdown, which was based on the markdown package instead of Pandoc. Later we called this version “R Markdown v1”. R Markdown v1 was more or less an experiment, although many people liked it (perhaps because they had suffered for too long from LaTeX). It did not take long before we started developing v2, i.e., rmarkdown. V1 was much less powerful than v2. For example, it only supported HTML output but not LaTeX or ..read more
Visit website
A Simple HTML Article Format
Yihui's Blog | R statistics
by
6M ago
A couple of weeks ago I wrote about a lightweight HTML presentation format, snap slides. Today I want to briefly introduce a simple and lightweight HTML article format. You can find an example page here, which is also its documentation. You can generate an article like this with either the R package markdown or Quarto or any other tool that can generate HTML output. Under the hood, this article format is based on CSS and JS, which can be reused on any web pages. If you use R Markdown or plain Markdown, you can install.packages('markdown') and specify the output format: output: markdown::htm ..read more
Visit website
Create Tabsets from HTML Sections or Bullet Lists via JavaScript and CSS
Yihui's Blog | R statistics
by
6M ago
As I wrote last month, code folding was the most requested feature in blogdown, of which I have given an implementation. Today I will demonstrate an implementation of another top requested feature: tabsets. How a tabset works The mechanism of tabsets is fairly simple. It boils down to a click event on a tab link, which triggers the display of a corresponding tab pane. The user interface in HTML is like this: <div > <div >Tab 1</div> <div >Tab 2</div> <div >Pane 1</div> <div >Pane 2</div> </div> If the first tab link is clic ..read more
Visit website
Three Useful Functions in Base R: `regexec()`, `strrep()`, and `append()`
Yihui's Blog | R statistics
by
6M ago
I just finished reviewing a pull request in the knitr repo that tries to improve the error message when it fails to parse YAML, and I feel three base R functions are worth mentioning to more R users. I have been inspired by Maëlle Salmon’s 3 functions blog series, and finally started writing one by myself. regexec(): get substrings with patterns If you want to master string processing using regular expressions (regex) with base R, the two help pages ?grep and ?regexp are pretty much all you need. Although I had read them many times in the past, I did not discover regexec() until about three ye ..read more
Visit website
An Example of Shortening R Code
Yihui's Blog | R statistics
by
6M ago
While I was answering a question from a user last week, I saw a piece of code that, in my opinion, could be shortened. What it does is to set two chunk options, message and warning, to NA or FALSE according the version of the evaluate package. setHook(packageEvent("knitr", "onLoad"), function(...) { message_default <- FALSE installed <- installed.packages() if ("evaluate" %in% rownames(installed)) { evaluate_installed <- installed["evaluate",] evaluate_version <- evaluate_installed[["Version"]] evaluate_vers ..read more
Visit website
Implement Dark Mode with One Line of CSS
Yihui's Blog | R statistics
by
7M ago
Personally I do not like the dark mode. I love sharp full-black text on clean white background, which gives me the same feeling as reading on paper. Reading in the dark mode makes me feel lost in the dark, but I know many people are the opposite, therefore in this crowded world of numerous dichotomous choices, web developers and authors have one more decision to make: should the website support the dark mode? To support the dark mode well from the scratch is not a trivial task. You may have to tweak a lot of colors, depending on how many colors you use on your webiste. That is one of the reaso ..read more
Visit website

Follow Yihui's Blog | R statistics on FeedSpot

Continue with Google
Continue with Apple
OR