or:
within(data.frame(x = rnorm(10)), y <- 3 * x + 5)
or:
within(data.frame(x = rnorm(10)), y <- 3 * x + 5)
Yes, (in theory) you can. I mentioned the possibility in the last section of the post.
The man (manual of R packages), the myth (extremely confusing), the legend (`graphics::legend()`). Generated via Google Gemini with my intentionally confusing prompts.
No one understands my soul better than you.
Sorry I'm a few years late to the party, but I'm here finally! :) yihui.org/en/2026/01/h... Thank you all so much for your generous support over the past two years!
With knitr/rmarkdown, you can also include other chunks in one chunk: bookdown.org/yihui/rmarkd... Unless I misread Knuth's paper when I was a graduate student, I think knitr had implemented what he mentioned.
Unfortunately or maybe fortunately, it's no longer actively maintained because there isn't much to maintain anymore. Pin the Hugo version, and then it's stable as rock :)
I wonder if this new $600 iPhone would last another 10 years. I'm not optimistic about it... I hate that things are so tightly tied to phones, and phone apps become the only way out.
Finally I had to let go my 10-year-old iPhone 6 last week because I must install MS Authenticator. Basically my old iPhone couldn't install any app due to its age, which had been fine to me because I use only one app primarily until last week when certain IT department started requiring this MS app.
And using cbind() in a loop to keep adding columns is also very inefficient (because R has to keep making new copies of `price` in the loop). You should retrieve all of the 6th columns and make the `price` data frame at the end in one go.
eval(parse()) is neither secure nor robust. If you know variable names, you should get()/mget() them, e.g.,
mget(nasdaq100_symbols) |>
lapply(`[`, 6) |>
as.data.frame()
However, when you have to use mget() to process data, you may have to rethink your data structure: yihui.org/en/2023/04/g...
To me, closing/deleting posts without knowing what the posts really mean is most annoying problem of StackOverflow (yihui.org/en/2018/02/c...). Time and time again, they just try to destroy valid posts. This time, none of Mark Rotteveel, gnat, Wai Ha Lee, and ChrisMM seem to have expertise in R.
The revised xkcd "Dependency" cartoon. The top text: "All modern social media platforms". The bottom text: "The attention span of some random person in Nebraska since 2003".
This poor Nebraskan is watching every social media platform...
Great memory. Yes, I was the culprit :) It's been 12 years: stat.ethz.ch/pipermail/r-...
If this is only intended for the profiling purpose, I think the litedown solution is much simpler than the knitr hook:
1. litedown::reactor(time = TRUE); litedown::roam() # navigate to vignettes/
2. Add
```{r}
litedown::timing_data()
```
to the end of each Rmd file, and preview them.
Hi Michael, I quoted this as the epigraph of this chapter: yihui.org/litedown/#ch... Please let me know if you prefer not to be quoted, and I'll be happy to remove it. Thanks!
The chunk option verbose = 2 in litedown does what you want, and I've finally finished documenting it: yihui.org/litedown/#se...
I've thought about this problem many times in the past, and have also come up with a simple solution early this year (no need to repeat the object name after the assignment or use a special pipe or explicit print()). I just need to find time to document it (among many other things in litedown)...
You might be interested in litedown (my current best effort in making things lightweight), and if you don't need executable code, you can just write plain .md posts instead of .Rmd (of course, math and bibliography are supported for .md, too).
With great power comes a great number of Github issues.
The wisdom is, always remember the goal is get the writing done, instead of learning what's new/cool/possible in tools for writing, which is tempting (& easier than writing) but bottomless. If LaTeX + Rnw can get the job done, there's nothing wrong of using them, even if they sound "old-fashioned".
I've become one of the tired horses in recent years and can't tell if the complexity of Markdown is still far below LaTeX as claimed originally. When I created knitr, I felt there would be no reason for anyone to use Sweave anymore. Now (13 years later), I see wisdom in people who still use Sweave.