For an R tutorial I want to show how easy it is to see the source code of a function by just typing the name in the console / pressing F2 in Rstudio. I'm looking for a function that is
- written in R (not using .Call, .External, .Internal etc)
- simple (not calling UseMethod)
- short
- common (in base/stats/graphics etc)
- useful
I'm currently thinking of rug
, but that already has quite some if-else levels. Any nicer ideas?
plot(density(faithful$eruptions))
rug(density(faithful$eruptions))
rug
(Of course I'll in a second step reference to https://github.com/wch/r-source/blob/trunk/src/library/graphics/R/rug.R and e.g. How can I view the source code for a function?)