I am looking for a way to autocomplete an argument of a function while typing (i.e. with tab).
For example, let say I have a function f with an argument name and I want to be able to autocomplete name from a list of possible names c("AAA","BBBBB","C") and as I am typing on the terminal
f(name="A
if I hit tab then it should autocomplete to
f(name="AAA"
and continue typing more arguments the function may need.
The solution so far is defining the list with select.list:
f<-function(name=select.list(c("AAA","BBBBB","C")),graphics=FALSE),other arguments...)
and let the user select the name from the list that is displayed immediately after calling the function, but I want to avoid doing this since the list may be quite large.
PS I found the function select.list after reading the question R Prompt User With Autocomplete