Duncan Murdoch
2021-Jun-23 17:10 UTC
[R] interactively getting alist of functions for a given package?
On 23/06/2021 8:37 a.m., Greg Minshall wrote:> hi. > > at the R prompt, i often hit, e.g., "data.table::<TAB>", to try to find > a routine in a give package. > > however, some packages have a *lot* of functions (i'm looking at *you*, > ggplot2...), so if i know the routine name starts with, e.g., "set", i > can filter the returned list of routines by typing > "data.table::set<TAB>" to get a list of completions. > > but, what if i know the name *contains*, but doesn't start with, "set"? > > is there an obvious way to find this? something like the unix-y > : ls /bin | grep -i "set"Bert gave you an answer that depends on ls(). Whether there's something like "set<TAB>" that can return "asset" probably depends on your front end, and may be customizable using the facilities described in ?rcompgen. Duncan Murdoch
Jeff Newmiller
2021-Jun-23 18:51 UTC
[R] interactively getting alist of functions for a given package?
RStudio seems to have done this. If you have it, try typing ggplot2::line and the popup will suggest (among other options) geom_line. On June 23, 2021 10:10:07 AM PDT, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:>On 23/06/2021 8:37 a.m., Greg Minshall wrote: >> hi. >> >> at the R prompt, i often hit, e.g., "data.table::<TAB>", to try to >find >> a routine in a give package. >> >> however, some packages have a *lot* of functions (i'm looking at >*you*, >> ggplot2...), so if i know the routine name starts with, e.g., "set", >i >> can filter the returned list of routines by typing >> "data.table::set<TAB>" to get a list of completions. >> >> but, what if i know the name *contains*, but doesn't start with, >"set"? >> >> is there an obvious way to find this? something like the unix-y >> : ls /bin | grep -i "set" > >Bert gave you an answer that depends on ls(). Whether there's >something >like "set<TAB>" that can return "asset" probably depends on your front >end, and may be customizable using the facilities described in >?rcompgen. > >Duncan Murdoch > >______________________________________________ >R-help at r-project.org 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.-- Sent from my phone. Please excuse my brevity.
Greg Minshall
2021-Jun-24 08:39 UTC
[R] interactively getting alist of functions for a given package?
Duncan,> Bert gave you an answer that depends on ls(). Whether there's > something like "set<TAB>" that can return "asset" probably depends on > your front end, and may be customizable using the facilities described > in ?rcompgen.thanks. i am just using command line R on linux. i tried setting `rc.setting(fuzzy=TRUE, func=TRUE, ipck=TRUE)`, but `data.table::set<TAB>` still only shows names that start with "set". Bert's `ls` answer works, but did you have an idea of how else this might be made to work with rcompgen? cheers, Greg