Follow

In zsh (the default shell in MacOS), R launches the R programming language console.

r, in contrast, does ... what?

% which r
r: shell built-in command
% man r
No manual entry for r

I can't figure out how to do a web search for this one without getting results for R instead of r.

@peterdrake

Per man zshbuiltins, the builtin shell command r is equivalent to fc -e -, which, to my reading of the same manpage, selects the most recent command and executes it without editing.

@peterdrake

I don't understand the question. Are you curious to know what entering "r" by itself on the command line will do under all possible circumstances, or do you you want to fix it so that entering either "r" or "R" will launch the R console?

If the latter then I think,

alias r='R'

will fix it.

@Pat I was just curious because I didn't know the 'r' command. I'll usually run R through RStudio.

@peterdrake

Neither do I. I've never used zsh or R. But I just read the zsh manual and it says that an alias is applied first, so that's why I suggested it.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves. A STEM-oriented instance.

An inclusive free speech instance.
All cultures and opinions welcome.
Explicit hate speech and harassment strictly forbidden.
We federate with all servers: we don't block any servers.