find a previous command that starts with a certain letter

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

find a previous command that starts with a certain letter

CasasPrat,Merce [Ontario]
Hi,

I'm new to R (was using Matlab previously)

Matlab has a very convenient utility that I haven't been able to find in R. When working interactively, you can find a previous command that starts with a certain letter by typing such a letter and then pressing the cursor up key. In R I've seen that, despite the letter you type, when pressing the cursor up key, it goes to the immediately previous command.

So, do you know if there is any way in R to quickly search for previous commands starting with a certain letter?

 

Thanks!!

Merc´┐Ż

 


        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: find a previous command that starts with a certain letter

Loris Bennett-2
"CasasPrat,Merce [Ontario]" <[hidden email]> writes:

> Hi,
>
> I'm new to R (was using Matlab previously)
>
> Matlab has a very convenient utility that I haven't been able to find
> in R. When working interactively, you can find a previous command that
> starts with a certain letter by typing such a letter and then pressing
> the cursor up key. In R I've seen that, despite the letter you type,
> when pressing the cursor up key, it goes to the immediately previous
> command.
>
> So, do you know if there is any way in R to quickly search for
> previous commands starting with a certain letter?
>
>  
>
> Thanks!!
>
> Merce

You should be able to do

Ctrl-r

(for "reverse search") and then type any part of the command you want.
You can then also do

Ctrl-s

(for "search") to search in the other direction (i.e. towards more
recently entered commands).

These are all functions of the "readline" library, which is also used in
many other programs (such as the "bash" shell).

Cheers,

Loris

--
This signature is currently under construction.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: find a previous command that starts with a certain letter

Duncan Murdoch-2
In reply to this post by CasasPrat,Merce [Ontario]
On 18/02/2015 5:06 PM, CasasPrat,Merce [Ontario] wrote:
> Hi,
>
> I'm new to R (was using Matlab previously)
>
> Matlab has a very convenient utility that I haven't been able to find in R. When working interactively, you can find a previous command that starts with a certain letter by typing such a letter and then pressing the cursor up key. In R I've seen that, despite the letter you type, when pressing the cursor up key, it goes to the immediately previous command.
>
> So, do you know if there is any way in R to quickly search for previous commands starting with a certain letter?

This depends on what front end you are using.  In the Windows Rgui.exe,
you get what you saw.  In front-ends using readline, you can do it by
hitting Ctrl-R first.  (The Windows command-line interface, Rterm.exe,
uses this, as do many others.)  If you're using some other front-end,
you'll need to read its documentation.

Duncan Murdoch

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.