From 75cafe6b921599bfe5f8cebb3bb3d3fa9b74513e Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Tue, 7 Nov 2023 22:12:12 -0600 Subject: [PATCH] use definition lists to write updates in posts, and convert definition lists to
via https://github.com/yihui/misc.js/blob/main/js/dl-fieldset.js --- content/cn/2001-10-03-name-memory.md | 4 +- content/cn/2005-01-07-20-13-00.md | 4 +- ...008-08-31-an-introduction-to-processing.md | 6 ++- content/cn/2009-03-05-lyx-and-sweave.md | 4 +- ...nk-long-post-in-wordpress-and-shortcode.md | 4 +- ...-issues-in-latex-lyx-r-sweave-pgfsweave.md | 8 ++-- content/cn/2011-02-09-lyx-2-0-and-sweave.md | 4 +- ...02-13-chinese-input-methods-under-linux.md | 4 +- content/cn/2014-04-17-tax-return.md | 4 +- content/cn/2017-01-17-rice-wine.md | 4 +- content/cn/2017-02-26-formatR.md | 11 +++-- content/cn/2017-04-02-url-to-content.md | 4 +- content/cn/2017-04-07-mathjax-markdown.md | 20 ++------- content/cn/2017-06-06-lightweight-texlive.md | 4 +- content/cn/2017-12-24-immature-debug.md | 7 +-- content/cn/2018-06-04-late-blogdown.md | 4 +- .../cn/2020-02-19-procrastination-emotion.md | 4 +- content/cn/2020-07-14-high-schoolmates.md | 5 ++- content/en/2007-08-12-tidy-up-your-r-code.md | 20 +++++++-- ...-05-find-out-available-usernames-with-r.md | 24 +++++++--- content/en/2013-04-07-travis-ci-for-r.md | 4 +- content/en/2017-05-19-a-note-on-on-exit.md | 8 +++- content/en/2017-08-24-so-gh-email.md | 4 +- content/en/2017-09-29-thanks-max.md | 4 +- ...2017-10-09-emoji-stats-of-github-issues.md | 4 +- content/en/2017-10-19-later-recursion.md | 2 +- content/en/2017-11-15-pandoc-2.md | 4 +- .../2017-11-22-knitr-verbatim-code-chunk.md | 4 +- content/en/2017-12-21-silverberg-blog.md | 4 +- content/en/2017-12-27-library-methods.md | 4 +- content/en/2018-01-26-install-rgtk2-macos.md | 45 +++++++++++-------- content/en/2018-02-02-typing-fast.md | 6 ++- content/en/2018-02-03-more-convincing.md | 4 +- .../en/2018-02-14-tikzdevice-maintainer.md | 4 +- content/en/2018-02-16-career-crisis.md | 4 +- content/en/2018-02-23-alicia-knitr-engine.md | 4 +- content/en/2018-02-27-closed-so-question.md | 8 ++-- content/en/2018-03-06-hacking-rd.md | 4 +- .../2018-04-06-rprofile-trailing-newline.md | 6 ++- .../en/2018-06-11-xaringan-math-limerick.md | 30 ++++++++----- .../2018-06-14-homebrew-binary-r-packages.md | 4 +- content/en/2018-07-01-cranextra-macos.md | 4 +- content/en/2021-06-09-ols-consistency.md | 43 +++++++++--------- content/en/2023-01-05-knitr-stringr.md | 18 ++++---- content/en/2023-02-06-xfun-isfalse.md | 12 ++--- content/en/2023-09-07-knitr-1-44.md | 16 ++++--- static/css/custom.css | 7 ++- themes/hugo-paged | 2 +- 48 files changed, 254 insertions(+), 158 deletions(-) diff --git a/content/cn/2001-10-03-name-memory.md b/content/cn/2001-10-03-name-memory.md index 42c6c0b592..0cf5f042b3 100644 --- a/content/cn/2001-10-03-name-memory.md +++ b/content/cn/2001-10-03-name-memory.md @@ -4,11 +4,11 @@ date: '2001-10-03' slug: name-memory --- -> 今天是公元 2001 年 10 月 3 日,掐指一算,离开(5)班已有一个月零两天了。唯恐将同窗一年的同学好友们淡忘,于是将原二(5)班的五十三口人的名字掐成一篇“文章”,谨以此记之。[^1] +> 今天是公元 2001 年 10 月 3 日,掐指一算,离开(5)班已有一个月零两天了。唯恐将同窗一年的同学好友们淡忘,于是将原二(5)班的五十三口人的名字掐成一篇“文章”,谨以此记之。 > > ——题记 -话说这一天,YZ 起了个大清早,见东方已经露出胡晓曦,便跑到覃江边去洗脸,水中的几朵盛开的黄雪莲在早上的陈晨晖的映衬下像卢娇一样娇,江中水平如汤平,一丝波纹都没有。 +话说这一天[^1],YZ 起了个大清早,见东方已经露出胡晓曦,便跑到覃江边去洗脸,水中的几朵盛开的黄雪莲在早上的陈晨晖的映衬下像卢娇一样娇,江中水平如汤平,一丝波纹都没有。 洗完了脸,YZ 沿着一条郭璐向刘耀东方走去。东方的那轮田阳越升越高了,YZ 慢慢走进一座山,忽然他看到一棵松树底下有一棵姓郭的灵芝,叫郭灵芝,他心中乐得像陈玉乐一样乐,于是他用一把王剑把灵芝挖了出来,小心翼翼地带在身上。 diff --git a/content/cn/2005-01-07-20-13-00.md b/content/cn/2005-01-07-20-13-00.md index 111b923169..4bf9d62ace 100644 --- a/content/cn/2005-01-07-20-13-00.md +++ b/content/cn/2005-01-07-20-13-00.md @@ -4,13 +4,13 @@ date: '2005-01-07T20:13:00+08:00' slug: 20-13-00 --- -![沙加](https://db.yihui.org/hexun/b_DC54A44095AFE95B.jpg) - > 美丽的花开了,可它也会有一天凋谢 在这个世界上,生命是一瞬也不会停止的 它一直在动着,变着,这就是无常 人的一生也是这样 +![沙加](https://db.yihui.org/hexun/b_DC54A44095AFE95B.jpg) + > 但是,最后还是只有一死...... > 这难道不可以说,人生还是被悲伤所支配着吗? > 活着的时候 无论是克服痛苦还是追求喜悦 diff --git a/content/cn/2008-08-31-an-introduction-to-processing.md b/content/cn/2008-08-31-an-introduction-to-processing.md index a4d06d87be..87514eb42f 100644 --- a/content/cn/2008-08-31-an-introduction-to-processing.md +++ b/content/cn/2008-08-31-an-introduction-to-processing.md @@ -6,7 +6,7 @@ slug: an-introduction-to-processing 上次在不莱梅的时候我曾经看见过AT&T的Debby在浏览一个网页,当时我也不知道那个网页是什么,没太在意,只记得她说"the examples are silly",而前两天我突然发现我知道她当时看的是什么了,那就是Processing! -网址:[http://processing.org/](http://processing.org/) +网址: 刚才本来已经收笔了,突然想起来这件事,不得不记下来,因为我觉得这门语言的设计理念和我做动画的想法非常一致,以后我可以考虑利用它。 @@ -16,5 +16,7 @@ Processing语言的作者为Casey Reas和Benjamin Fry(MIT的家伙),他们 不知各位听我罗嗦了半天昏昏欲睡的看官看了这些东西之后是不是也有点战斗欲望呢? -> 2012/03/15更新:四年后我再来看,发现这个项目已经成长为专门的网站了 而且居然有在线IDE! +2012-03-15 更新 + +: 四年后我再来看,发现这个项目已经成长为专门的网站了 而且居然有在线 IDE! diff --git a/content/cn/2009-03-05-lyx-and-sweave.md b/content/cn/2009-03-05-lyx-and-sweave.md index 96f7e06592..62798d68cb 100644 --- a/content/cn/2009-03-05-lyx-and-sweave.md +++ b/content/cn/2009-03-05-lyx-and-sweave.md @@ -4,7 +4,9 @@ date: '2009-03-05' slug: lyx-and-sweave --- -> 2013/02/05更新:knitr包已经可完美替代Sweave,并且在LyX中有很好的支持。参见[这篇日志](/cn/2010/02/misc-issues-in-latex-lyx-r-sweave-pgfsweave/)。 +2013-02-05 更新 + +: knitr包已经可完美替代Sweave,并且在LyX中有很好的支持。参见[这篇日志](/cn/2010/02/misc-issues-in-latex-lyx-r-sweave-pgfsweave/)。 有些LaTeX用户可能觉得敲代码太费事了,那么这里推荐一下LyX。[LyX](http://www.lyx.org)是一个所见即所得的编辑器,因为它基于LaTeX,所以排版质量没啥好说的。关键是它可以和Sweave结合起来用,只要到CRAN[下载LyX相关配置文件](http://cran.r-project.org/contrib/extra/lyx/)就可以了。 diff --git a/content/cn/2009-05-15-blank-long-post-in-wordpress-and-shortcode.md b/content/cn/2009-05-15-blank-long-post-in-wordpress-and-shortcode.md index 315dfed5cb..38e2e08e4c 100644 --- a/content/cn/2009-05-15-blank-long-post-in-wordpress-and-shortcode.md +++ b/content/cn/2009-05-15-blank-long-post-in-wordpress-and-shortcode.md @@ -4,7 +4,9 @@ date: '2009-05-15' slug: blank-long-post-in-wordpress-and-shortcode --- -> 2009-06-14更新:自从WordPress 2.8开始,这里的正则表达式又变了,经本人测试,`'(.?)\ [('.$tagregexp.')\b([^\ [\ ]\r\n]*?)(?:(\/))?\](?:(.+?)\ [\/\2\])?(.?)'` 是有效的。 +2009-06-14 更新 + +: 自从WordPress 2.8开始,这里的正则表达式又变了,经本人测试,`'(.?)\ [('.$tagregexp.')\b([^\ [\ ]\r\n]*?)(?:(\/))?\](?:(.+?)\ [\/\2\])?(.?)'` 是有效的。 这两天捣鼓Wordpress,遇到了无数的问题,估计Google不下百次,有些问题实在诡异,不过幸好都让我找到了答案。例如,昨天被这个问题搞得几乎崩溃:有的帖子在更新发布之后就变成空白了,刚开始我以为是数据库连接问题,后来在phpMyAdmin中检查了一遍又一遍,甚至直接更改数据库,都没法让文章显示出来,于是又去查codex,看`the_content()`等函数,依旧无果。最后在千般尝试下,发现把文章删除一部分文字之后就可以显示出来了,于是我意识到这与被删的文字有关,但从未听说Wordpress系统对文章内容有审查啊,所以应该不是关键词过滤的问题,我于是一句一句话地删除,看删到哪里之后文章就发不出了,最后统计了一下字节数,但这个数字对解决问题根本没用,因为不能因此就避免长文章。 diff --git a/content/cn/2010-02-08-misc-issues-in-latex-lyx-r-sweave-pgfsweave.md b/content/cn/2010-02-08-misc-issues-in-latex-lyx-r-sweave-pgfsweave.md index c00fb3d960..83621ab873 100644 --- a/content/cn/2010-02-08-misc-issues-in-latex-lyx-r-sweave-pgfsweave.md +++ b/content/cn/2010-02-08-misc-issues-in-latex-lyx-r-sweave-pgfsweave.md @@ -4,9 +4,11 @@ date: '2010-02-08' slug: misc-issues-in-latex-lyx-r-sweave-pgfsweave --- -> 2013/02/05更新:本文已经严重过期。pgfSweave包基本上已经进入不维护的状态,我的[knitr包](/knitr)已经可以完全替代它;LyX已经有大规模更新,本文提到的问题都已经在官方版本中解决,所有暗黑招数都已经没有必要。参见[以下视频](http://www.screenr.com/embed/SvL8)(已失效): -> -> +2013-02-05 更新 + +: 本文已经严重过期。pgfSweave包基本上已经进入不维护的状态,我的[knitr包](/knitr)已经可以完全替代它;LyX已经有大规模更新,本文提到的问题都已经在官方版本中解决,所有暗黑招数都已经没有必要。参见[以下视频](http://www.screenr.com/embed/SvL8)(已失效): + + 我不确定这是不是R和Sweave能达到的最漂亮的境界:[一份由pgfSweave生成的人模狗样的动态文档](https://bitbucket.org/stat/www/downloads/lyx-pgfsweave.pdf)。 diff --git a/content/cn/2011-02-09-lyx-2-0-and-sweave.md b/content/cn/2011-02-09-lyx-2-0-and-sweave.md index 7d4bb11b99..9af4cbf84c 100644 --- a/content/cn/2011-02-09-lyx-2-0-and-sweave.md +++ b/content/cn/2011-02-09-lyx-2-0-and-sweave.md @@ -4,7 +4,9 @@ date: '2011-02-09' slug: lyx-2-0-and-sweave --- -> 2013/02/05更新:本文已经严重过期,请不要模仿暗黑招数;参见[这篇日志](/cn/2010/02/misc-issues-in-latex-lyx-r-sweave-pgfsweave/)。 +2013-02-05 更新 + +: 本文已经严重过期,请不要模仿暗黑招数;参见[这篇日志](/cn/2010/02/misc-issues-in-latex-lyx-r-sweave-pgfsweave/)。 转眼间LyX 2.0已经陆续发布beta 1, 2, 3, 4,希望不要再发beta 5,直接出正式版吧。这回在LyX 2.0中Sweave有了内生支持,不过它自带的Sweave的缺点一大堆,前天上午本来想给LyX报告一下这些事情,结果写着写着,自个儿发现了解决办法,昏死,写了几大段道理,白写了。抄起键盘给2.0写了个Sweave自动配置脚本,仅仅在Ubuntu下测试了一下,貌似还挺好使。勇猛的Linux用户可以自行下载LyX 2.0 beta4源代码包编译安装,然后在R里运行: diff --git a/content/cn/2011-02-13-chinese-input-methods-under-linux.md b/content/cn/2011-02-13-chinese-input-methods-under-linux.md index dc2cac7224..65ab13b163 100644 --- a/content/cn/2011-02-13-chinese-input-methods-under-linux.md +++ b/content/cn/2011-02-13-chinese-input-methods-under-linux.md @@ -4,7 +4,9 @@ date: '2011-02-13' slug: chinese-input-methods-under-linux --- -> 2012/07/29更新:我最终还是收敛到ibus sunpinyin上了。输入法归根结底,还是习惯问题。 +2012-07-29 更新 + +: 我最终还是收敛到ibus sunpinyin上了。输入法归根结底,还是习惯问题。 虽然稍微慢了点,不过正确率还蛮高的:ibus-cloud-pinyin。据说是用的搜狗和QQ的云端,不知道寿命会不会长久……之前找了个SCIM Google拼音输入法,但实在是太容易崩溃,另外还有个Sun pinyin,出字速度比我打字速度还慢。 diff --git a/content/cn/2014-04-17-tax-return.md b/content/cn/2014-04-17-tax-return.md index 23f7cb2653..7e55b6bd1e 100644 --- a/content/cn/2014-04-17-tax-return.md +++ b/content/cn/2014-04-17-tax-return.md @@ -4,7 +4,9 @@ date: '2014-04-17' slug: tax-return --- -> 2022-04-15 更新:今天发现一个开源免费报税网站 ,不知是否好用。 +2022-04-15 更新 + +: 今天发现一个开源免费报税网站 ,不知是否好用。 在美帝年复一年总是有一件非常烦人的事情,就是报税,其实政府有我们的收入数据,报税这事情本来可以电子化和自动化,但每年我们都要汇总各种表格,回忆到底上次是几月几号回国,几月几号入境,各种乱七八糟的信息一项一项填啊算啊,最终弄出几份稅表(国税/州税/市税)打印出来贴上邮票寄给IRS,IRS再安排人检查这些纸表,邮寄支票或往银行账户直接汇款。 diff --git a/content/cn/2017-01-17-rice-wine.md b/content/cn/2017-01-17-rice-wine.md index f63687125e..2ae50f424c 100644 --- a/content/cn/2017-01-17-rice-wine.md +++ b/content/cn/2017-01-17-rice-wine.md @@ -14,6 +14,6 @@ slug: rice-wine 我的做法出来酒水相对较少,浓度比较高,嫌甜可以自行加水稀释。我老家有用米酒煮油条吃的,也有冲蛋花汤的。 ---- +两年后更新 -两年后更新:米酒刚做出来时,[需要另外再加水](/cn/2019/07/last-step/)。加水之后再放冰箱,还可以继续发酵变甜。 +: 米酒刚做出来时,[需要另外再加水](/cn/2019/07/last-step/)。加水之后再放冰箱,还可以继续发酵变甜。 diff --git a/content/cn/2017-02-26-formatR.md b/content/cn/2017-02-26-formatR.md index b301ab42fb..2c2b6932f4 100644 --- a/content/cn/2017-02-26-formatR.md +++ b/content/cn/2017-02-26-formatR.md @@ -4,11 +4,16 @@ date: '2017-02-26' slug: formatR --- -2021-03-22 更新:下面的第一个愿望已经在 [formatR 1.9](https://github.com/yihui/formatR/blob/master/NEWS.md) 中实现。 +2021-03-22 更新 -2021-05-27 更新:下面的第二个愿望已经在 [formatR 1.11](https://github.com/yihui/formatR/blob/master/NEWS.md) 中实现。 +: 下面的第一个愿望已经在 [formatR 1.9](https://github.com/yihui/formatR/blob/master/NEWS.md) 中实现。 + + + +2021-05-27 更新 + +: 下面的第二个愿望已经在 [formatR 1.11](https://github.com/yihui/formatR/blob/master/NEWS.md) 中实现。 ---- [2010 年](/cn/2010/03/new-r-package-formatr/)我发布了一个叫 [formatR](/formatr) 的 R 包,它可以把乱糟糟的 R 代码自动清理成大致整齐的代码(例如自动加空格、换行等),这个包也是我当年做 knitr 的小小动力之一。虽然 formatR 是个小麻雀包,但它的开发过程中也有三个里程碑事件: diff --git a/content/cn/2017-04-02-url-to-content.md b/content/cn/2017-04-02-url-to-content.md index 9226abb60b..794d6c0128 100644 --- a/content/cn/2017-04-02-url-to-content.md +++ b/content/cn/2017-04-02-url-to-content.md @@ -4,9 +4,9 @@ date: '2017-04-02' slug: url-to-content --- -2021-03-26 更新:我本人已经从下文中提到的 Netlify 迁移到 Vercel 上,[原因见此](https://d.cosx.org/d/421538/81)。下文提到的 Migadu 邮箱服务现在也已经没有了免费版。 +2021-03-26 更新 ---- +: 我本人已经从下文中提到的 Netlify 迁移到 Vercel 上,[原因见此](https://d.cosx.org/d/421538/81)。下文提到的 Migadu 邮箱服务现在也已经没有了免费版。 最近一年好像流行“真相竟然是这样”或者“啥啥竟然咋咋”的句式。从来不拒绝恶俗的我也在标题里跟个风。 diff --git a/content/cn/2017-04-07-mathjax-markdown.md b/content/cn/2017-04-07-mathjax-markdown.md index 02cf91875c..8a2397374e 100644 --- a/content/cn/2017-04-07-mathjax-markdown.md +++ b/content/cn/2017-04-07-mathjax-markdown.md @@ -100,23 +100,9 @@ Markdown,简单。MathJax,简单。两个搁一块儿,说简单也可以 然后我发现有些数学公式没被处理掉。数来数去,页面里的 `` 标签数量比上面代码处理的标签数量少一些,最终发现,`codes = document.getElementsByTagName('code')` 这对象竟然是个活的!也就是说,我每删掉一个 `` 标签,它里面都会自动少一个元素(尽管我在循环之前就已经对 `codes` 赋值了)。所以,我每删一个 `` 标签,都**不能**把 `i` 增加 1 。比如删掉了第 9 个标签之后,原本的第 10 个标签就变成第 9 个标签了。只有一个标签没处理的时候,才需要 `i++`。这上哪儿说理去…… - > 2023-09-12 更新:上面的坑可以如此这般更加优雅地填平,也就是用 `[...]` 生成数组然后用 `.forEach()` 方法遍历其中的元素,这样就不需要管下标了。 - > - > ```js - > [...document.getElementsByTagName('code')].forEach(code => { - > if (code.parentNode.tagName === 'PRE' || code.childElementCount > 0) return; - > let text = code.textContent; - > if (/^\$[^$]/.test(text) && /[^$]\$$/.test(text)) { - > text = text.replace(/^\$/, '\\(').replace(/\$$/, '\\)'); - > code.textContent = text; - > } - > if (/^\\\((.|\s)+\\\)$/.test(text) || /^\\\[(.|\s)+\\\]$/.test(text) || - > /^\$(.|\s)+\$$/.test(text) || - > /^\\begin\{([^}]+)\}(.|\s)+\\end\{[^}]+\}$/.test(text)) { - > code.outerHTML = code.innerHTML; // remove - > } - > }); - > ``` +2023-09-12 更新 + +: 上面的坑可以[如此这般](https://github.com/yihui/misc.js/commit/633fcc8)更加优雅地填平,也就是用 `[...]` 生成数组然后用 `.forEach()` 方法遍历其中的元素,这样就不需要管下标了。 总而言之,这段代码运行完之后数学公式脱离了代码标签,然后就可以异步加载 MathJax 渲染公式了,为自己和广大人民群众省下了好几毫秒的时间! diff --git a/content/cn/2017-06-06-lightweight-texlive.md b/content/cn/2017-06-06-lightweight-texlive.md index 7e9fd987b8..25fc1f1222 100644 --- a/content/cn/2017-06-06-lightweight-texlive.md +++ b/content/cn/2017-06-06-lightweight-texlive.md @@ -4,7 +4,9 @@ date: '2017-06-06' slug: lightweight-texlive --- -> 2017/12/18 更新:这个问题我终于自己动手基本解决了,参见 [TinyTeX](/tinytex/)。它是一个特制版本的 TeX Live,在 macOS/Linux 下安装后的大小大约是 150 兆。 +2017-12-18 更新 + +: 这个问题我终于自己动手基本解决了,参见 [TinyTeX](/tinytex/)。它是一个特制版本的 TeX Live,在 macOS/Linux 下安装后的大小大约是 150 兆。 要把我最烦恼的软件问题排个名的话,我第一烦 Windows 下的字符编码问题,因为 UTF-8 明明可以一统江湖,在 Windows 下这个破问题却一直是一桶浆糊,永远杀不死;第二烦的就是 LaTeX 安装问题,因为这个问题明明有简化的可能,却也是一桶浆糊状态。Windows / Linux / macOS 各自打各自的江山,都是用的那种我最不喜欢的少数一两个人掌握核心权力的旧时代软件包分发办法。 diff --git a/content/cn/2017-12-24-immature-debug.md b/content/cn/2017-12-24-immature-debug.md index a32060a915..2b87c78e91 100644 --- a/content/cn/2017-12-24-immature-debug.md +++ b/content/cn/2017-12-24-immature-debug.md @@ -18,9 +18,10 @@ slug: immature-debug CentOS 时,[我就感觉不太对劲](https://d.cosx.org/d/419672/87);他不回答我为什么作为一个刚接触 CentOS -系统时间不长、却非得对这个系统这么执着,还要卯足了劲要生死往前冲,感觉这就是纯粹为了折腾而折腾。[^1] +系统时间不长、却非得对这个系统这么执着,还要卯足了劲要生死往前冲,感觉这就是纯粹为了折腾而折腾。 -[^1]: 2022-05-19 更新:湘云解释说是因为公司里的服务器环境是 - CentOS,所以当时是我的误会,抱歉抱歉。 +2022-05-19 更新 + +: 湘云解释说是因为公司里的服务器环境是 CentOS,所以当时是我的误会,抱歉抱歉。 当然,有点折腾精神是好的,人不折腾枉少年,只是少年还得惜取少年时,适可而止。不过这种话要是说给十年前的我自己听,也未必能听进去。 diff --git a/content/cn/2018-06-04-late-blogdown.md b/content/cn/2018-06-04-late-blogdown.md index ac531411c5..89dd335e1d 100644 --- a/content/cn/2018-06-04-late-blogdown.md +++ b/content/cn/2018-06-04-late-blogdown.md @@ -6,4 +6,6 @@ slug: late-blogdown Thomas Lumley 大人[在推特上感叹](https://twitter.com/tslumley/status/1002795504000905216),“交换过眼神,你(blogdown)是对的人,可惜就是太晚了。”Lumley 大人在统计学家里可能是除了 Gelman 大人和 Xi'an 之外写个人博客频率最高的人。最近他尝试了几次把自己的博客转到 blogdown 框架下,不过貌似因为文章数量太大,尚未成功,目测好像会成为《blogdown:从入门到放弃》的用户之一。不过洒家已经很满意了,因为我最乐意看到的就是博客老手开始尝试 blogdown。对新手而言,创建一个全新的网站太简单了,基本没什么挑战性(除了在挑选一个漂亮的主题时会有选择困难症之外)。老手里面,最感人的例子是 Rob Hyndman,我在 blogdown 的书中[提过这个例子](https://bookdown.org/yihui/blogdown/migration.html),他用了一次长途飞行完成了把网站切换到 blogdown 的最关键一步,剩下的前前后后收拾还花了好几天。 -更新:嚯,就在我写完上面这段话八小时后,Lumley 大人竟然咬牙[完成了华丽的转身](https://notstatschat.rbind.io)!怎么每次都是我刚写谁谁就转部落格党,上次 Harrell 大人[也是这样](/cn/2018/01/r-web-sprout/)。 +更新 + +: 嚯,就在我写完上面这段话八小时后,Lumley 大人竟然咬牙[完成了华丽的转身](https://notstatschat.rbind.io)!怎么每次都是我刚写谁谁就转部落格党,上次 Harrell 大人[也是这样](/cn/2018/01/r-web-sprout/)。 diff --git a/content/cn/2020-02-19-procrastination-emotion.md b/content/cn/2020-02-19-procrastination-emotion.md index d11b2a050f..575f2bddaa 100644 --- a/content/cn/2020-02-19-procrastination-emotion.md +++ b/content/cn/2020-02-19-procrastination-emotion.md @@ -10,6 +10,6 @@ slug: procrastination-emotion 过去几个月我开始教大娃认汉字。很快他就开始抗拒了,但他性格相对比较温顺,所以在我的威逼利诱下一直坚持每天学几个字。在一小块巧克力的目标引诱下,他认完了第一盒卡片,共三百多字,然后我说这块巧克力归你了,但他只是每天品尝一小口——他就是有这么可怕的延迟满足能力,一块巧克力可以在眼前摆两个月不吃,即使送给他了他也不一口气吃完。认了四百多字之后,他抗拒越来越强烈,有时候都会抹眼泪。我觉得这么下去也不是个办法,毕竟我也不愿意强迫他学汉字。以前我都是在他睡前教他认字(晚九点前),他有时候在这个时间点会说困,我也不知他是真困还是找借口,反正他认字时经常心情不好。前几天我决定换个策略,改成一吃完晚饭就先认字,这时候精力比较充沛。以前是每天复习前两天的十几个字,然后学七个新字;这几天我每天给他复习前一周多的五十多个字,再学新的七个字,结果效果比之前要好得多,他也没再哭闹了。这可能也算通过恰当的情绪管理来促进做成本不愿意做的事情的一个例子吧。 ---- +三天后更新 -三天后更新:每天复习五十多个字他已经受不了了,又开始抹眼泪。看来这个情绪管理策略也不太奏效,他不愿意学认字的主要原因应该还是我给他的任务过重。我只好调整为每天只认十来个字,且观后效。 +: 每天复习五十多个字他已经受不了了,又开始抹眼泪。看来这个情绪管理策略也不太奏效,他不愿意学认字的主要原因应该还是我给他的任务过重。我只好调整为每天只认十来个字,且观后效。 diff --git a/content/cn/2020-07-14-high-schoolmates.md b/content/cn/2020-07-14-high-schoolmates.md index 6eb7406ba7..e996bcde5d 100644 --- a/content/cn/2020-07-14-high-schoolmates.md +++ b/content/cn/2020-07-14-high-schoolmates.md @@ -2,6 +2,7 @@ title: 记几位高中同学 date: '2020-07-14' slug: high-schoolmates +show_toc: false --- @@ -23,7 +24,9 @@ slug: high-schoolmates 这两天我在班里的微信群里挨个问同学,除了两位同学说还隐约有点印象外,其他所有我问过的同学都非常肯定地说班里没有这个人,觉得是我记错了。如果绝大部分同学都完全不记得这个人的存在,那可能真的就彻底失联了。莫非后来她辍学了,或是发生了什么我们所有人都不知道的意外?你到底去哪儿了? -2021-08-02 更新:今天重新回忆此事时,意识到我记错了年级。她是我高一的同学,而不是高二,怪不得我问高二的同学全都不记得了。问了一个高一的同学,他向我确认了这个同学的存在。那看来还有希望能找到她。 +2021-08-02 更新 + +: 今天重新回忆此事时,意识到我记错了年级。她是我高一的同学,而不是高二,怪不得我问高二的同学全都不记得了。问了一个高一的同学,他向我确认了这个同学的存在。那看来还有希望能找到她。 ## LF diff --git a/content/en/2007-08-12-tidy-up-your-r-code.md b/content/en/2007-08-12-tidy-up-your-r-code.md index 18e22b15d3..b95866ef9e 100644 --- a/content/en/2007-08-12-tidy-up-your-r-code.md +++ b/content/en/2007-08-12-tidy-up-your-r-code.md @@ -4,13 +4,25 @@ date: '2007-08-12' slug: tidy-up-your-r-code --- -> Update on 2012/03/04: later the idea was turned into a package [**formatR**](http://cran.r-project.org/package=formatR) and many details have been enhanced there. See the [wiki page](https://github.com/yihui/formatR/wiki) for demos. +Update on 2012/03/04 -In the past I used to make use of `source(my_source_file, echo = TRUE, prompt = "")` to "tidy up" my code because it's not convenient for me to type every space between operators, what's more, I have no fixed rules to break a line or make a proper indent. Thus I need a function to automatically "tidy up" my code. +: Later the idea was turned into a package + [**formatR**](http://cran.r-project.org/package=formatR) and many details + have been enhanced there. See the [Github + repo](https://github.com/yihui/formatR) for details. -After I read the source code of the function `source()`, I quickly found that the actual workhorse is `parse()`, which can turn your code file into neat expressions, and the rest work is just to extract substrings. Here is a proof of concept: +In the past I used to make use of +`source(my_source_file, echo = TRUE, prompt = "")` to "tidy up" my code because +it's not convenient for me to type every space between operators, what's more, I +have no fixed rules to break a line or make a proper indent. Thus I need a +function to automatically "tidy up" my code. -```r +After I read the source code of the function `source()`, I quickly found that +the actual workhorse is `parse()`, which can turn your code file into neat +expressions, and the rest work is just to extract substrings. Here is a proof of +concept: + +``` r tidy.source = function(file = choose.files()) { exprs = parse(file) for (i in 1:length(exprs)) { diff --git a/content/en/2013-01-05-find-out-available-usernames-with-r.md b/content/en/2013-01-05-find-out-available-usernames-with-r.md index ec5e33808f..a176338e98 100644 --- a/content/en/2013-01-05-find-out-available-usernames-with-r.md +++ b/content/en/2013-01-05-find-out-available-usernames-with-r.md @@ -4,13 +4,25 @@ date: '2013-01-05' slug: find-out-available-usernames-with-r --- -> Update on 2013/01/05: Xiao Nan in the comments pointed out that `apply(combn(letters, 2), 2, paste0, collapse = '')` was wrong for all two-letter usernames, and indeed it was. It is not a combination problem. Now I use his elegant `outer()` solution. One can also use `expand.grid(letters, letters)`. +Update on 2013/01/05 -Github [decided](https://github.com/blog/1302-goodbye-uploads) to take off their downloads service, and I was very unhappy with this decision. This means I have to migrate several files to other places, and update links accordingly. I saw [Bitbucket](https://bitbucket.org/) still provides the service, so I want to migrate my files there. +: Xiao Nan in the comments pointed out that + `apply(combn(letters, 2), 2, paste0, collapse = '')` was wrong for all + two-letter usernames, and indeed it was. It is not a combination problem. + Now I use his elegant `outer()` solution. One can also use + `expand.grid(letters, letters)`. -Sadly my name `yihui` was already taken on Bitbucket, so I hoped I could get a short name, which made me think how I could check the availability of a username via programming, and here was my solution with the **RCurl** package: +Github [decided](https://github.com/blog/1302-goodbye-uploads) to take off their +downloads service, and I was very unhappy with this decision. This means I have +to migrate several files to other places, and update links accordingly. I saw +[Bitbucket](https://bitbucket.org/) still provides the service, so I want to +migrate my files there. -```r +Sadly my name `yihui` was already taken on Bitbucket, so I hoped I could get a +short name, which made me think how I could check the availability of a username +via programming, and here was my solution with the **RCurl** package: + +``` r library(RCurl) test_user = function(site = 'https://bitbucket.org/', candidates = c(0:9, letters)) { @@ -27,4 +39,6 @@ test_user(candidates = as.vector(outer(letters, letters, 'paste0'))) test_user('https://github.com/') ``` -As of the time of this blog post, there are no two-letter usernames left on Github, but some are still available on Bitbucket, e.g. `by` and `eq`, etc, and the number `4` is also available. +As of the time of this blog post, there are no two-letter usernames left on +Github, but some are still available on Bitbucket, e.g. `by` and `eq`, etc, and +the number `4` is also available. diff --git a/content/en/2013-04-07-travis-ci-for-r.md b/content/en/2013-04-07-travis-ci-for-r.md index f3861e4b44..3bf9be0c66 100644 --- a/content/en/2013-04-07-travis-ci-for-r.md +++ b/content/en/2013-04-07-travis-ci-for-r.md @@ -25,4 +25,6 @@ A similar platform in the R world is [Bioconductor](http://bioconductor.org/chec Anyone? -> Update on 04/16/2013: just to clarify, what Bioconductor does is not strictly continuous integration (yet) in the sense that it builds packages daily instead of immediately on changes. +Update on 2013-04-16 + +: Just to clarify, what Bioconductor does is not strictly continuous integration (yet) in the sense that it builds packages daily instead of immediately on changes. diff --git a/content/en/2017-05-19-a-note-on-on-exit.md b/content/en/2017-05-19-a-note-on-on-exit.md index 96728ff837..6b3d97e562 100644 --- a/content/en/2017-05-19-a-note-on-on-exit.md +++ b/content/en/2017-05-19-a-note-on-on-exit.md @@ -4,7 +4,9 @@ date: '2017-05-19' slug: a-note-on-on-exit --- -> **Update on 2020/06/23:** The issue mentioned in this post [has been fixed](https://github.com/wch/r-source/commit/5bd6e3ce) in R 4.0.2, thanks to Martin Maechler. +Update on 2020-06-23 + +: The issue mentioned in this post [has been fixed](https://github.com/wch/r-source/commit/5bd6e3ce) in R 4.0.2, thanks to Martin Maechler. I have used `on.exit()` for several years, but it was not until the other day that I realized a very weird thing about it: you'd better follow the default positions of its arguments `expr` and `add`, i.e., the first argument has to be `expr` and the second has to be `add`. @@ -36,4 +38,6 @@ I don't have the capability to understand the [source code in C](https://github. BTW, I don't know the rationale for the default `add = FALSE` in `on.exit()`, but I have not used `add = FALSE` for a single time, so I feel `add = TRUE` might be a better default. When I want to do something on exit, I almost surely mean do it _in addition to_ the things that I assigned to `on.exit()` before, instead of cleaning up all previous tasks and only doing this one (`add = FALSE`). -> **Update on 2018/01/17**: Half a year later, [I was bitten by the same problem](https://github.com/rstudio/tinytex/issues/12) again in the **tinytex** package. Never, ever, do `on.exit(add = TRUE, expr)`. +Update on 2018-01-17 + +: Half a year later, [I was bitten by the same problem](https://github.com/rstudio/tinytex/issues/12) again in the **tinytex** package. Never, ever, do `on.exit(add = TRUE, expr)`. diff --git a/content/en/2017-08-24-so-gh-email.md b/content/en/2017-08-24-so-gh-email.md index f1e213303a..f94e1e3af9 100644 --- a/content/en/2017-08-24-so-gh-email.md +++ b/content/en/2017-08-24-so-gh-email.md @@ -31,7 +31,9 @@ I have pushed people to Stack Overflow many times in the past, and I'd say most This morning I received an email about a **knitr** question. I was very happy that the sender read my email policy before. Actually she posted [the question](https://stackoverflow.com/q/44656046/559676) on Stack Overflow two months ago, and waited till today to email me with the link to the post. I very much appreciate her patience. Again, as a sign of appreciation, I answered the question a few minutes later. It is actually a good question. Had this question come to my inbox first, I'd probably have ignored it. -> **Update on 2017/08/25**: This post reminded [Tim Appelhans](https://twitter.com/TimSalabim3/status/900962571024441345) of a [Stack Overflow question](https://stackoverflow.com/q/17502050/559676) that he posted four years ago. That was an interesting question, and I guess few users would be able to find the answer without reading the **knitr** source code, so I'd be very glad to answer this kind of questions. +Update on 2017-08-25 + +: This post reminded [Tim Appelhans](https://twitter.com/TimSalabim3/status/900962571024441345) of a [Stack Overflow question](https://stackoverflow.com/q/17502050/559676) that he posted four years ago. That was an interesting question, and I guess few users would be able to find the answer without reading the **knitr** source code, so I'd be very glad to answer this kind of questions. ## Github Issues diff --git a/content/en/2017-09-29-thanks-max.md b/content/en/2017-09-29-thanks-max.md index 403003a285..db8c3986d7 100644 --- a/content/en/2017-09-29-thanks-max.md +++ b/content/en/2017-09-29-thanks-max.md @@ -14,4 +14,6 @@ I feel quite stressful in the past few weeks due to something personal and time- ![force a cat to bathtub](https://slides.yihui.org/gif/drag-cat.gif) -> **Update on 2017/10/01**: I just realized Max had sent [a pull request](https://github.com/davidgohel/ggiraph/pull/75) to fix the issue he reported before I posted an answer on Stack Overflow! That is even better! +Update on 2017-10-01 + +: I just realized Max had sent [a pull request](https://github.com/davidgohel/ggiraph/pull/75) to fix the issue he reported before I posted an answer on Stack Overflow! That is even better! diff --git a/content/en/2017-10-09-emoji-stats-of-github-issues.md b/content/en/2017-10-09-emoji-stats-of-github-issues.md index e297e2ca10..aa4e30b3db 100644 --- a/content/en/2017-10-09-emoji-stats-of-github-issues.md +++ b/content/en/2017-10-09-emoji-stats-of-github-issues.md @@ -12,6 +12,8 @@ I'd like to provide the Github repo name, and get the summary statistics of _rea ![Waiting for help](https://slides.yihui.org/gif/questions.gif) -> **Update on 2017/11/16**: Yang has prepared a [Github repo](https://github.com/yiluheihei/github_issues_reactions), and it worked well for me. Thanks, Yang! +Update on 2017-11-16 + +: Yang has prepared a [Github repo](https://github.com/yiluheihei/github_issues_reactions), and it worked well for me. Thanks, Yang! [^1]: Note I don't mean emoji characters used in text, but reactions only. Currently Github has only provided six possible reactions. diff --git a/content/en/2017-10-19-later-recursion.md b/content/en/2017-10-19-later-recursion.md index ca093249e1..7c17464063 100644 --- a/content/en/2017-10-19-later-recursion.md +++ b/content/en/2017-10-19-later-recursion.md @@ -37,7 +37,7 @@ I don't want to mislead users who do not read the documentation of **later**, so Basically this means you cannot expect the task will be executed precisely every N seconds (e.g., N = 10 in the above example), especially when there is another task that has occupied the R console. This is not a deal breaker in my original problem. I don't need the time to be precise. -## (Update on 2018/01/10) Won't this lead to infinite recursion? +## (Update on 2018-01-10) Won't this lead to infinite recursion? It didn't occur to me that there seemed to be an infinite recursion until [Miles McBain](https://twitter.com/MilesMcBain/status/950854460628123648) pointed it out, but my colleague [Alan Dipert](https://twitter.com/alandipert/status/950991363771850752) reassured us that the **later** package had the magic of avoiding stack buildup. It was such a surprise to me! Then my colleague [Joe confirmed it](https://twitter.com/jcheng/status/951108928993046528), and attributed it to Simon Urbanek. diff --git a/content/en/2017-11-15-pandoc-2.md b/content/en/2017-11-15-pandoc-2.md index ba4c0822b4..8ef416089c 100644 --- a/content/en/2017-11-15-pandoc-2.md +++ b/content/en/2017-11-15-pandoc-2.md @@ -5,7 +5,9 @@ date: '2017-11-15' slug: pandoc-2 --- -> **Update on 2018-06/13**: Half a year has passed, and I think the R Markdown ecosystem should be ready for Pandoc 2.x now. See [this post](/en/2018/06/time-for-pandoc-2-x/) for details. +Update on 2018-06-13 + +: Half a year has passed, and I think the R Markdown ecosystem should be ready for Pandoc 2.x now. See [this post](/en/2018/06/time-for-pandoc-2-x/) for details. Pandoc 2.0 was released two weeks ago. I have read its [release notes](https://github.com/jgm/pandoc/releases) a few times, and my conclusion is that for R Markdown users, there is no need to upgrade to Pandoc 2.0 from 1.x. I don't see any major benefits relevant to R Markdown. In fact, I'd encourage you to stay with Pandoc 1.19.x for now. diff --git a/content/en/2017-11-22-knitr-verbatim-code-chunk.md b/content/en/2017-11-22-knitr-verbatim-code-chunk.md index 8e1b07687c..dcaeb495a9 100644 --- a/content/en/2017-11-22-knitr-verbatim-code-chunk.md +++ b/content/en/2017-11-22-knitr-verbatim-code-chunk.md @@ -18,7 +18,9 @@ to explain the answer in greater detail in this post. ## Show a verbatim code chunk -**Update on 2022-06-16**: Since [**knitr** v1.37](/en/2022/01/knitr-news/), we +Update on 2022-06-16 + +: Since [**knitr** v1.37](/en/2022/01/knitr-news/), we have introduced a more natural way to write verbatim code chunks, i.e., using the `verbatim` engine. For example: diff --git a/content/en/2017-12-21-silverberg-blog.md b/content/en/2017-12-21-silverberg-blog.md index ff3dc061bb..89acdfd911 100644 --- a/content/en/2017-12-21-silverberg-blog.md +++ b/content/en/2017-12-21-silverberg-blog.md @@ -8,4 +8,6 @@ Yesterday I came across a very interesting blog cleverly named "[Alice's Adventu If any of my readers want to reach out to help, please feel free to. I have no idea if she'd like such an unsolicited offer, though. I can easily offer a free domain `alice.rbind.io` if desired. -> Update on 2018/01/04: She decided to host her blog on [Google sites](https://sites.google.com/site/numberlandadventures/), and you can subscribe to the RSS feed. +Update on 2018-01-04 + +: She decided to host her blog on [Google sites](https://sites.google.com/site/numberlandadventures/), and you can subscribe to the RSS feed. diff --git a/content/en/2017-12-27-library-methods.md b/content/en/2017-12-27-library-methods.md index 20ed4cdb34..785f5fd5a4 100644 --- a/content/en/2017-12-27-library-methods.md +++ b/content/en/2017-12-27-library-methods.md @@ -39,4 +39,6 @@ It is sad to see things that exist for historical reasons are so hard to change. P.S. Although S4 is innocent in this case, this is a minor reason why I never liked S4. -> **Update on 2017/01/06**: [Gabor discovered](https://twitter.com/GaborCsardi/status/949722120375988224) that Luke Tierney [finally made `Rscript` consistent with `R`](https://github.com/wch/r-source/commit/c30ffef956) by default, i.e., **methods** will be attached in a future version of `Rscript`. It seems the long-lasting confusion will be ended in 2018. +Update on 2017-01-06 + +: [Gabor discovered](https://twitter.com/GaborCsardi/status/949722120375988224) that Luke Tierney [finally made `Rscript` consistent with `R`](https://github.com/wch/r-source/commit/c30ffef956) by default, i.e., **methods** will be attached in a future version of `Rscript`. It seems the long-lasting confusion will be ended in 2018. diff --git a/content/en/2018-01-26-install-rgtk2-macos.md b/content/en/2018-01-26-install-rgtk2-macos.md index f2f3dd569a..b454791a8d 100644 --- a/content/en/2018-01-26-install-rgtk2-macos.md +++ b/content/en/2018-01-26-install-rgtk2-macos.md @@ -5,25 +5,32 @@ date: '2018-01-26' slug: install-rgtk2-macos --- -> **Update on 2023-05-15**: Please ignore this post, because **RGtk2** has been -> removed from CRAN. It is impossible to build it anymore. - -> **Update on 2018-06-13**: Because this issue has bothered me over and over -> again, I decided to work on some pre-built binaries of R packages for the -> Homebrew version of R. If you are using the latest versions of R (from either -> CRAN or Homebrew Cask) and macOS, you can ignore this post, and just install -> **RGtk2** with: -> -> ``` r -> system('brew install gtk+') -> install.packages('RGtk2', type = 'binary', repos = 'https://macos.rbind.io') -> ``` -> -> You no longer need to edit the Homebrew formula as suggested in the post -> below, which is too complicated, time-consuming, and hard to maintain. BTW, I -> have experimented with the idea of building binary packages for the Homebrew -> version of R. See [this post](/en/2018/07/cranextra-macos/) for more -> information. +Update on 2023-05-15 + +: Please ignore this post, because **RGtk2** has been removed from CRAN. It is + impossible to build it anymore. + + + +Update on 2018-06-13 + +: Because this issue has bothered me over and over again, I decided to work on + some pre-built binaries of R packages for the Homebrew version of R. If you + are using the latest versions of R (from either CRAN or Homebrew Cask) and + macOS, you can ignore this post, and just install **RGtk2** with: + + ``` r + system('brew install gtk+') + install.packages( + 'RGtk2', type = 'binary', repos = 'https://macos.rbind.io' + ) + ``` + + You no longer need to edit the Homebrew formula as suggested in the post + below, which is too complicated, time-consuming, and hard to maintain. BTW, + I have experimented with the idea of building binary packages for the + Homebrew version of R. See [this post](/en/2018/07/cranextra-macos/) for + more information. While I'm doing my "favorite" thing in R (running `R CMD check` on thousands of reverse dependencies), I realized the **RGtk2** package was *just* updated on diff --git a/content/en/2018-02-02-typing-fast.md b/content/en/2018-02-02-typing-fast.md index 75351c8504..0282d1ab0b 100644 --- a/content/en/2018-02-02-typing-fast.md +++ b/content/en/2018-02-02-typing-fast.md @@ -50,9 +50,11 @@ delayedAssign('go', { You may ask why not define a normal function, like `go = function() { ... }`? I didn't want to type `go()` in my console, because that would look suspicious to the audience whose eyes are really good, and they might know I called a function to do something. If I just type `go`, even if they saw it, I don't think they would so quickly think of delayed assignments in R, and they might think I was trying to print a certain object in R, but didn't see its value for some reason after I press Enter. -**Update on 2018-03-04**: The video of the talk is freely available [on the RStudio website](https://www.rstudio.com/resources/videos/create-and-maintain-websites-with-r-markdown-and-blogdown/). +Update on 2018-03-04 -[![Create and maintain websites with R Markdown and blogdown – RStudio](https://embedwistia-a.akamaihd.net/deliveries/3a89d37534901d8aea63adaa722e644c547345ce.jpg?image_play_button_size=2x&image_crop_resized=960x540&image_play_button=1&image_play_button_color=4287c7e0)](https://www.rstudio.com/resources/videos/create-and-maintain-websites-with-r-markdown-and-blogdown/?wvideo=zvnt290yte) +: The video of the talk is freely available [on the RStudio website](https://www.rstudio.com/resources/videos/create-and-maintain-websites-with-r-markdown-and-blogdown/). + + [![Create and maintain websites with R Markdown and blogdown – RStudio](https://embedwistia-a.akamaihd.net/deliveries/3a89d37534901d8aea63adaa722e644c547345ce.jpg?image_play_button_size=2x&image_crop_resized=960x540&image_play_button=1&image_play_button_color=4287c7e0)](https://www.rstudio.com/resources/videos/create-and-maintain-websites-with-r-markdown-and-blogdown/?wvideo=zvnt290yte) ## Appendix: Does `yolo: true` work in blogdown? diff --git a/content/en/2018-02-03-more-convincing.md b/content/en/2018-02-03-more-convincing.md index 3e0f8fa5fc..a6768ab73d 100644 --- a/content/en/2018-02-03-more-convincing.md +++ b/content/en/2018-02-03-more-convincing.md @@ -17,4 +17,6 @@ The above evidence speaks louder than your CV. Everyone can say that he/she is g I have never been involved with hiring people, but if I do, I'd check if they have personal websites or have written anything nontrivial. -> Update on 2018-02-16: After I read the comments by Rebecca Robare and sleight82 below, I realized that I made a mistake. I think Eduardo's words resonated well with me partly because I would be a good candidate meeting the above criteria (I use GIT every day, I have given numerous talks, and I'm highly self-motivated). In other words, I unconsciously chose to write down things that were good for myself. In conclusion, I think this post was biased, and I'd welcome more managers to share their critiria. +Update on 2018-02-16 + +: After I read the comments by Rebecca Robare and sleight82 below, I realized that I made a mistake. I think Eduardo's words resonated well with me partly because I would be a good candidate meeting the above criteria (I use GIT every day, I have given numerous talks, and I'm highly self-motivated). In other words, I unconsciously chose to write down things that were good for myself. In conclusion, I think this post was biased, and I'd welcome more managers to share their criteria. diff --git a/content/en/2018-02-14-tikzdevice-maintainer.md b/content/en/2018-02-14-tikzdevice-maintainer.md index ab80f1d6f6..c617e513b5 100644 --- a/content/en/2018-02-14-tikzdevice-maintainer.md +++ b/content/en/2018-02-14-tikzdevice-maintainer.md @@ -4,7 +4,9 @@ date: '2018-02-14' slug: tikzdevice-maintainer --- -> **Update on 2018-06-19**: We have found a new maintainer (Ralf Stubner), and the Github repo has been transferred to https://github.com/daqana/tikzDevice. +Update on 2018-06-19 + +: We have found a new maintainer (Ralf Stubner), and the Github repo has been transferred to https://github.com/daqana/tikzDevice. Today the **tikzDevice** package was orphaned [on CRAN](https://cran.rstudio.com/package=tikzDevice), mainly because neither Kirill Müller nor I have time to maintain it (both of us have other priorities). I [still love](/en/2011/04/produce-authentic-math-formulas-in-r-graphics/) the fact that it makes it possible to write native LaTeX expressions in R plots and generate high-quality PDF. I still think it has the most appealing PDF vignette among all R packages I have seen. diff --git a/content/en/2018-02-16-career-crisis.md b/content/en/2018-02-16-career-crisis.md index f0e233c561..a4afc13e2b 100644 --- a/content/en/2018-02-16-career-crisis.md +++ b/content/en/2018-02-16-career-crisis.md @@ -247,9 +247,9 @@ I want to quote Ray Dalio again to finalize this post. I went through a long per Thanks, Tareef, JJ, and Joe. ---- +Update on 2018-02-17 -**Update on 2018-02-17**: After I published this post, I received a lot of feedback in a short period of time, and I truly appreciate all your thoughts, encouragements, and care. I will see if I could summarize them in the future. For now, I just want to clarify it to those who were concerned about my mental health issues: I'm no longer depressed. The years 2016 and 2017 have been fantastic, and I have mostly recovered. Thanks again! +: After I published this post, I received a lot of feedback in a short period of time, and I truly appreciate all your thoughts, encouragements, and care. I will see if I could summarize them in the future. For now, I just want to clarify it to those who were concerned about my mental health issues: I'm no longer depressed. The years 2016 and 2017 have been fantastic, and I have mostly recovered. Thanks again! [^1]: Stephanie was the happiest graduate student in the department. I still miss her laughter as well as Prof Dan Nordman's. diff --git a/content/en/2018-02-23-alicia-knitr-engine.md b/content/en/2018-02-23-alicia-knitr-engine.md index 373101eab6..c7be2a94b5 100644 --- a/content/en/2018-02-23-alicia-knitr-engine.md +++ b/content/en/2018-02-23-alicia-knitr-engine.md @@ -17,4 +17,6 @@ So thanks, Alicia. I started my day in a pleasant morning. BTW, have I mentioned how awesome [Nick Strayer and Lucy D'Agostino McGowan](http://livefreeordichotomize.com) are? -**Update on 2018-03-02**: [Colin Fay is also awesome!](https://twitter.com/_ColinFay/status/969183208687448064) Thanks! +Update on 2018-03-02 + +: [Colin Fay is also awesome!](https://twitter.com/_ColinFay/status/969183208687448064) Thanks! diff --git a/content/en/2018-02-27-closed-so-question.md b/content/en/2018-02-27-closed-so-question.md index 08a901575d..228c63db2e 100644 --- a/content/en/2018-02-27-closed-so-question.md +++ b/content/en/2018-02-27-closed-so-question.md @@ -16,10 +16,10 @@ Yesterday I saw a question about **blogdown** [on Stack Overflow](https://stacko I still don't understand the benefit of closing questions on Stack Overflow. If you close a question, no one can answer it (you'll have to wait for five people to vote to re-open it), even if it is a valid question. If you don't close it in such a hurry, what will be the bad consequences? ---- +Update on 2022-05-27 -**Update on 2022-05-27**: Four years later, I want to rant about Stack Overflow moderators deleting valid answers like [in this post](https://stackoverflow.com/q/72400889/559676). The moderator has not answered a single `r` or `knitr` question before, but brutally deleted an answer from the OP. +: Four years later, I want to rant about Stack Overflow moderators deleting valid answers like [in this post](https://stackoverflow.com/q/72400889/559676). The moderator has not answered a single `r` or `knitr` question before, but brutally deleted an answer from the OP. -![A Stack Overflow deleted a valid answer](https://user-images.githubusercontent.com/163582/170794778-a07d3d16-4832-4004-906b-f8b186c56c3f.png) + ![A Stack Overflow deleted a valid answer](https://user-images.githubusercontent.com/163582/170794778-a07d3d16-4832-4004-906b-f8b186c56c3f.png) -Is it a perfect answer? No. Could it be the good start of a great answer? Yes. What's the point of deleting it in such a hurry when the moderator doesn't appear to have the relevant knowledge about the post? + Is it a perfect answer? No. Could it be the good start of a great answer? Yes. What's the point of deleting it in such a hurry when the moderator doesn't appear to have the relevant knowledge about the post? diff --git a/content/en/2018-03-06-hacking-rd.md b/content/en/2018-03-06-hacking-rd.md index 3488e801de..2a2b780326 100644 --- a/content/en/2018-03-06-hacking-rd.md +++ b/content/en/2018-03-06-hacking-rd.md @@ -14,4 +14,6 @@ This morning I learned another amazing hack from Noam Ross, and the hack was eve ![Oh my... You hackers are so awesome](https://slides.yihui.org/gif/slow-applaud.gif) -**Update on 2018-08-01**: I discovered [yoni sidi's `
` hack](https://twitter.com/yoniceedee/status/1024740274495528960). +Update on 2018-08-01 + +: I discovered [yoni sidi's `
` hack](https://twitter.com/yoniceedee/status/1024740274495528960). diff --git a/content/en/2018-04-06-rprofile-trailing-newline.md b/content/en/2018-04-06-rprofile-trailing-newline.md index 4d82e39f17..a8b8d1dd6c 100644 --- a/content/en/2018-04-06-rprofile-trailing-newline.md +++ b/content/en/2018-04-06-rprofile-trailing-newline.md @@ -1,5 +1,5 @@ --- -title: The Trouble of .Rprofile if it Doesn't Have a Trailing Newline +title: The Trouble of `.Rprofile` if it Doesn't Have a Trailing Newline date: '2018-04-06' slug: rprofile-trailing-newline --- @@ -14,4 +14,6 @@ Anyway, I always configure my text editors to add a newline to the end of text f ![Ensure that source files end with newline in RStudio](https://db.yihui.org/images/rstudio-newline.png) -Update on 2018-06-05: This issue just [continues to confuse more users](https://stackoverflow.com/q/50686292/559676). +Update on 2018-06-05 + +: This issue just [continues to confuse more users](https://stackoverflow.com/q/50686292/559676). diff --git a/content/en/2018-06-11-xaringan-math-limerick.md b/content/en/2018-06-11-xaringan-math-limerick.md index 7d493491ab..c21fc9c714 100644 --- a/content/en/2018-06-11-xaringan-math-limerick.md +++ b/content/en/2018-06-11-xaringan-math-limerick.md @@ -4,20 +4,26 @@ date: '2018-06-12' slug: xaringan-math-limerick --- -When my colleague Kevin Kuo asked a question about a problematic LaTeX math expression in a **xaringan** presentation, Claus Ekstrøm [replied with an amusing limerick](https://github.com/yihui/xaringan/issues/146): +When my colleague Kevin Kuo asked a question about a problematic LaTeX math +expression in a **xaringan** presentation, Claus Ekstrøm [replied with an +amusing limerick](https://github.com/yihui/xaringan/issues/146): > When dollars appear it's a sign -that your code does not quite align -Ensure that your math -in xaringan hath -been placed on a single long line +> that your code does not quite align +> Ensure that your math +> in xaringan hath +> been placed on a single long line -I laughed out loud. That was much better than my ["official" documentation](https://slides.yihui.org/xaringan/#16)! +I laughed out loud. That was much better than my ["official" +documentation](https://slides.yihui.org/xaringan/#16)! -**Update on 2018-07-02**: Another limerick by Claus [on three dashes](https://github.com/yihui/xaringan/issues/151#issuecomment-401827615): +Update on 2018-07-02 -> Three dashes are used for a split -But careful when using your wit -'Cause you must erase -any sign of a space -or else it will just look like ... +: Another limerick by Claus [on three + dashes](https://github.com/yihui/xaringan/issues/151#issuecomment-401827615): + + > Three dashes are used for a split + > But careful when using your wit + > 'Cause you must erase + > any sign of a space + > or else it will just look like ... diff --git a/content/en/2018-06-14-homebrew-binary-r-packages.md b/content/en/2018-06-14-homebrew-binary-r-packages.md index 13a3fa2c62..fb24045015 100644 --- a/content/en/2018-06-14-homebrew-binary-r-packages.md +++ b/content/en/2018-06-14-homebrew-binary-r-packages.md @@ -5,7 +5,9 @@ date: '2018-06-14' slug: homebrew-binary-r-packages --- -> **Update on 2018-07-01**: I have changed the scope of the repository https://macos.rbind.io. Please ignore the post below, and see [this post](/en/2018/07/cranextra-macos/) instead. +Update on 2018-07-01 + +: I have changed the scope of the repository https://macos.rbind.io. Please ignore the post below, and see [this post](/en/2018/07/cranextra-macos/) instead. One of the open source projects is not like the others. The project is called [Homebrew](https://brew.sh). In my eyes, it is *the* most successful open source project in history in several aspects. I saw an interesting graph [on Twitter](https://twitter.com/nayafia/status/1004526578175361024) a few days ago, which perfectly characterized the amazing community nature of Homebrew: diff --git a/content/en/2018-07-01-cranextra-macos.md b/content/en/2018-07-01-cranextra-macos.md index a7e4c5b88d..6fa6a46209 100644 --- a/content/en/2018-07-01-cranextra-macos.md +++ b/content/en/2018-07-01-cranextra-macos.md @@ -5,7 +5,9 @@ date: '2018-07-01' slug: cranextra-macos --- -> **Update on 2023-05-15**: Please ignore this post. This project has been archived because [the original motivation](/en/2018/01/install-rgtk2-macos/) is no longer valid. +Update on 2023-05-15 + +: Please ignore this post. This project has been archived because [the original motivation](/en/2018/01/install-rgtk2-macos/) is no longer valid. Two weeks ago [I announced](/en/2018/06/homebrew-binary-r-packages/) the repository `macos.rbind.io`, and asked for feedback in [RStudio Community](https://community.rstudio.com/t/9907). After reading my colleague Jim Hester's feedback and doing some research on the differences between `brew install r` and `brew install --cask r`, I decided to switch to the latter.[^1] Consequently, I changed the scope of the repository `macos.rbind.io` to only building the missing binary packages on CRAN. Windows users may have heard of the so-called "CRANextra" repository, which contains binary R packages that are not available on CRAN. The repository `macos.rbind.io` is also a CRANextra repository, but created for macOS users. diff --git a/content/en/2021-06-09-ols-consistency.md b/content/en/2021-06-09-ols-consistency.md index 9a90ef58ac..bb7013181f 100644 --- a/content/en/2021-06-09-ols-consistency.md +++ b/content/en/2021-06-09-ols-consistency.md @@ -90,7 +90,7 @@ plot( ) abline(h = 2, lwd = 2) points(10000, 2.0014, col = 'red', cex = 2, lwd = 2) -arrows(10000, 2.0014, 8000, 1.99, ) +arrows(10000, 2.0014, 8000, 1.99) text(8000, 1.987, 'Estimate from the simulation mentioned in the tweet') ``` @@ -98,7 +98,7 @@ text(8000, 1.987, 'Estimate from the simulation ![Different estimated values of beta as N increases](https://user-images.githubusercontent.com/163582/121392349-ea28bf80-c914-11eb-8b3d-44a523ac6a2e.png) I have also marked the value 2.0014 in the plot corresponding to the sample size -10000. +10,000. ## Does it really converge to the true parameter value? @@ -114,22 +114,23 @@ Xie](/en/2017/06/on-formality/)). My intuition is that `$y \approx 2x + a\sqrt{x} + c$`, where `$a$` is a small constant. I will appreciate it if anyone could give a rigorous explanation. ---- - -**Update on 2021/06/10**: [Nick has given an -explanation](https://twitter.com/nickchk/status/1403185713659539456), which is -quite obvious in hindsight. `X` and `e` are actually correlated in the above -simulation, because `X` contains a linear term `e`, i.e., for -`X = e + 100e^2 + Z`, `e^2` and `Z` are not correlated with `e`, but `e` itself -is certainly correlated with `e`. The correct simulation should be done without -the linear term in `X` (or use `abs(e)`, which is also not correlated with `e`): - -``` r -beta_est = function(N = 10) { - e = runif(N) - x = 100 * (e - .5)^2 + rnorm(N) - y = 2 * x + e - res = lm.fit(cbind(1, x), y) - res$coefficients[2] # the slope -} -``` +Update on 2021-06-10 + +: [Nick has given an + explanation](https://twitter.com/nickchk/status/1403185713659539456), which + is quite obvious in hindsight. `X` and `e` are actually correlated in the + above simulation, because `X` contains a linear term `e`, i.e., for + `X = e + 100e^2 + Z`, `e^2` and `Z` are not correlated with `e`, but `e` + itself is certainly correlated with `e`. The correct simulation should be + done without the linear term in `X` (or use `abs(e)`, which is also not + correlated with `e`): + + ``` r + beta_est = function(N = 10) { + e = runif(N) + x = 100 * (e - .5)^2 + rnorm(N) + y = 2 * x + e + res = lm.fit(cbind(1, x), y) + res$coefficients[2] # the slope + } + ``` diff --git a/content/en/2023-01-05-knitr-stringr.md b/content/en/2023-01-05-knitr-stringr.md index 777bc412aa..de1be9fac1 100644 --- a/content/en/2023-01-05-knitr-stringr.md +++ b/content/en/2023-01-05-knitr-stringr.md @@ -71,13 +71,13 @@ install.packages('knitr', repos = c( Thanks! --------------------------------------------------------------------------------- +Update on 2023-01-19 -**Update on 2023/01/19**: We (mainly [@cderv](https://github.com/cderv)) have -finished benchmarking and you can [read a report -here](https://github.com/cderv/knitr/blob/bench-stringr-replace/inst/benchmark/stringr-replace.md). -Some of our base R functions are faster than **stringr** equivalents, and some -are slower. Overall I don't have any concerns on the slower functions, -because 1) some of them are used in processing `.Rnw` documents only, and 2) the -absolute time of one function call is often less than one millisecond, which -shouldn't be noticeable even if it is 3 or 4 times slower. +: We (mainly [\@cderv](https://github.com/cderv)) have finished benchmarking + and you can [read a report + here](https://github.com/cderv/knitr/blob/bench-stringr-replace/inst/benchmark/stringr-replace.md). + Some of our base R functions are faster than **stringr** equivalents, and + some are slower. Overall I don't have any concerns on the slower functions, + because 1) some of them are used in processing `.Rnw` documents only, and 2) + the absolute time of one function call is often less than one millisecond, + which shouldn't be noticeable even if it is 3 or 4 times slower. diff --git a/content/en/2023-02-06-xfun-isfalse.md b/content/en/2023-02-06-xfun-isfalse.md index c7b6b1eeb3..84d94c77af 100644 --- a/content/en/2023-02-06-xfun-isfalse.md +++ b/content/en/2023-02-06-xfun-isfalse.md @@ -4,11 +4,13 @@ date: '2023-02-06' slug: xfun-isfalse --- -> **Update on 2023-09-07**: you probably came to this blog post due to an error -> related to `xfun::isFALSE()`, and I strongly recommend that you [update all -> your R packages](/en/2017/05/when-in-doubt-upgrade/): -> `update.packages(ask = FALSE, checkBuilt = TRUE)` That's because the error is -> most likely to be from one of your outdated packages. +Update on 2023-09-07 + +: You probably came to this blog post due to an error related to + `xfun::isFALSE()`, and I strongly recommend that you [update all your R + packages](/en/2017/05/when-in-doubt-upgrade/): + `update.packages(ask = FALSE, checkBuilt = TRUE)` That's because the error + is most likely to be from one of your outdated packages. Base R has had the function `isTRUE()` for many years, and I had wished for a few years that there were an `isFALSE()`, too. I had used `identical(x, FALSE)` diff --git a/content/en/2023-09-07-knitr-1-44.md b/content/en/2023-09-07-knitr-1-44.md index a803087816..c6fb32a27b 100644 --- a/content/en/2023-09-07-knitr-1-44.md +++ b/content/en/2023-09-07-knitr-1-44.md @@ -4,13 +4,15 @@ date: '2023-09-07' slug: knitr-1-44 --- -> **Update on 2023-09-12**: **knitr** v1.44 is on CRAN now and I realized that -> locking `opts_current` might be a nontrivial breaking change (sorry about -> that). If your code or package is affected by the locked `opts_current` object -> and you run into an error "*The object is read-only and cannot be modified*", -> you can call `opts_current$lock(FALSE)` to unlock it before you call -> `opts_current$set()`. I assume that you are modifying `opts_current` for a -> legitimate reason. +Update on 2023-09-12 + +: **knitr** v1.44 is on CRAN now and I realized that locking `opts_current` + might be a nontrivial breaking change (sorry about that). If your code or + package is affected by the locked `opts_current` object and you run into an + error "*The object is read-only and cannot be modified*", you can call + `opts_current$lock(FALSE)` to unlock it before you call + `opts_current$set()`. I assume that you are modifying `opts_current` for a + legitimate reason. After coming back from [vacation](/en/2023/06/on-vacation/), I mainly spent my time on the **knitr** package maintenance. I will make a new release soon, and diff --git a/static/css/custom.css b/static/css/custom.css index 9db8a82d24..a0a3b25fc6 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -20,10 +20,13 @@ h1.title::before { content: "➶"; } text-align: center; margin: 2em 0 1em; } -.main > blockquote:first-child, #TableOfContents + blockquote { - border-left-color: yellow; +dl, fieldset { background-color: lightyellow; font-size: .9em; + border-width: 1px; +} +dt, legend { + font-weight: bold; } .archive > h2 { text-align: initial; diff --git a/themes/hugo-paged b/themes/hugo-paged index 28194dbd3a..1eec247557 160000 --- a/themes/hugo-paged +++ b/themes/hugo-paged @@ -1 +1 @@ -Subproject commit 28194dbd3ab978f7d3b79ded1f6714675ad5c51c +Subproject commit 1eec2475575ba78745ffebf6bae34d32c980dfa0