title: Custom autocomplete functions in R possible?
body: <p>I am looking to create a custom function in R that will allow the user to call the function and then it will produce an auto complete pipeline ready for them to edit, this way they can jump into quickly customizing the standard pipeline instead of copy pasting from an old script or retyping. How can I go about setting up this sort of autocomplete:</p>
  
  <pre><code>#pseudo code what I type---
  seq.Date(1,2,by = "days") %&gt;%
    pblapply(function(x){
      read.fst(list.files(as.character(x), as.data.table = T) %&gt;%
                 group_by(x) %&gt;%
                 count()
    }) %&gt;% rbindlist()
  
  #how can I write a function so that when I call that function, it ouputs an autocomplete
  #of the above so that I can go ahead and start just customizing the code? Something like this
  my_autocomplete_function = function(x) {
    print(
      "
      seq.Date(as.Date(Sys.Date()),as.Date(Sys.Date()+1),by = 'days') %&gt;%
        pbapply::pblapply(function(x){
          fst::read.fst(list.files(as.character(x), as.data.table = T)) %&gt;%
            #begin filtering and grouping by below custom
            group_by()
  
  
        }) %&gt;% rbindlist()  
  ")
  }
  
  #I can just print the function and copy paste the text from the output in my console to my script
  my_autocomplete_function()
  #but I rather it just autocomplete and appear in the script if possible?
  </code></pre>