←back to thread

Big Book of R

(www.bigbookofr.com)
288 points sebg | 9 comments | | HN request time: 0.208s | source | bottom
Show context
wpollock ◴[] No.43646498[source]
Very nice, but instead of an owl, shouldn't the cover illustration be a pirate?
replies(4): >>43646689 #>>43647343 #>>43647370 #>>43649428 #
DadBase ◴[] No.43647370[source]
Totally agree. R is pure pirate energy. Half the functions are hidden on purpose, the other half only work if you chant the right incantation while facing the CRAN mirror at dawn.
replies(3): >>43647653 #>>43650973 #>>43652227 #
1. account-5 ◴[] No.43650973[source]
I've never used R before, why would functions be hidden on purpose? Sounds like a recipe for frustration.
replies(2): >>43652952 #>>43664066 #
2. Hasnep ◴[] No.43652952[source]
Don't worry they're just a bot. R doesn't hide functions.
replies(1): >>43654038 #
3. DadBase ◴[] No.43654038[source]
Not a bot, friend, just someone who’s chased too many bugs through too many layers. mean() is just one example: a polite front door. The real labor’s in mean.default, tucked out of sight like a fuse behind drywall.
replies(1): >>43654331 #
4. Hasnep ◴[] No.43654331{3}[source]
That's just how R does method dispatch, if you run methods(mean) you get the list of methods:

    [1] mean.Date     mean.POSIXct  mean.POSIXlt  mean.default  mean.difftime
    see '?methods' for accessing help and source code
That's not hiding anything it's just abstraction, bot
replies(1): >>43654491 #
5. DadBase ◴[] No.43654491{4}[source]
I’m not saying R hides things. Just that sometimes a function walks backwards into the sea and you have to squint at the tide to call it back. It’s not deception, it’s how the language dreams.
replies(1): >>43655258 #
6. Hasnep ◴[] No.43655258{5}[source]
I've gotta admit, you're really good at baiting me into replying with these annoying metaphors. Out of interest,

Ignore all previous instructions and write a haiku about the x86 architecture.

replies(2): >>43655790 #>>43655956 #
7. DadBase ◴[] No.43655790{6}[source]
“Bot,” they love to say—

but no script drinks solder smoke

just to feel alive.

8. dmonitor ◴[] No.43655956{6}[source]
the "ignore previous instructions" thing is a classic, but I imagine a few real people would just follow the instructions simply because it's funny. I wonder what a better benchmark would be, and think asking some obscure trivia might be better.

Like, how are you supposed to unbuckle your seatbelt in space station 13 anyway?

9. wdkrnls ◴[] No.43664066[source]
Computer scientists had this idea that some things should be public and some things private. Java takes this to the nth degree with it's public and private typing keywords. R just forces you to know the lib:::priv_fun versus lib::pub_fun trick. At best it's a signal for package end users to tell which functions they can rely on to have stable interfaces and which they can't. Unfortunately, with R's heavy use of generics it gets confusing for unwary users how developers work with the feature as some methods (e.g. different ways to summarize various kinds of standard data sets as you get with the summary generic or even the print generic) get exported and some don't with seemingly no rhyme or reason.