Hacker News new | ask | show | jobs
by bachmeier 2268 days ago
Thanks. I wasn't aware of showTree.

Most R users don't realize everything in R can be written as a function, due to its Scheme roots. Example:

if (3 > 2) { print("hello") }

can be rewritten with backticks on the if:

`if`(3 > 2, print("hello"))

If the first argument is false, you need a third argument

`if`(3 < 2, print("hello"), print("go away"))

Essentially, the backticks replace some parens you'd use in Scheme, and then you can add some alternative syntactic sugar to write in Algol style.

1 comments

Yup.

If you look in the source for R (in C), you will note that all of the data structure names end with Sexp.