Complete {svIDE} | R Documentation |
A list with matching items is returned in a string.
Complete(code, givetype = FALSE, fieldsep = "|")
code |
A fraction of R code needing completion |
givetype |
Do we append the type of each entry to the list? |
fieldsep |
The separator to use between the item and its type |
The completion list is context-dependent, and it calculated as if the code was entered at the command line.
If the code ends with $
or [[
, then the function look for items
in a list or data.frame whose name is the last idfentifier.
If the code ends with @
, then the function look for slots of the
corresponding S4 object.
If the code ends with a partial identifier name, the function returns all visible matching keywords.
In all other situations, the function returns a list of the objects in .GlobalEnv.
A string with the completion list
Philippe Grosjean <phgrosjean@sciviews.org>
## a data.frame data(iris) cat(Complete("item <- iris$"), "\n") cat(Complete("item <- iris[[", TRUE), "\n") ## An S4 object setClass("track", representation(x = "numeric", y = "numeric")) t1 <- new("track", x=1:20, y=(1:20)^2) cat(Complete("item2 <- t1@", TRUE), "\n") ## A partial identifier cat(Complete("item3 <- va", TRUE), "\n") ## Otherwise, a list with the content of .GlobalEnv cat(Complete("item4 <- "), "\n")