CompletePlus: Get completion and additional information from an R code fragment
Description
The function generates completion possibilities and investigate
within the R help file to gather information about each completion.Usage
CompletePlus(linebuffer, cursorPosition = nchar(linebuffer), minlength = 2,
simplify = FALSE, types = c("arguments", "functions", "packages"))
Arguments
linebuffer
R code fragment
cursorPosition
Position of the cursor in the fragment
minlength
Minimum size the fragment needs to be to perform the
completion
simplify
Logical. If TRUE, then the result is printed in strings with
tabulation as field separators.
types
Which types of items should we be looking for?
Value
- Either a matrix giving completion information. If simplify is set to TRUE,
nothing is returned but the result is
cat
directly to the console.
Details
The information given back depends on the kind of completion performed. If a
potential completion ends with the equal sign, then CompletePlus
tries
to get information on the argument from the guessed function. If the potential
completion ends with ::
, then the CompletePlus
gets information
about the package. If the potential completion is a function, then
CompletePlus
retrieves the title of the function as documented in
the man page, if the function is documented.Examples
Run this codeCompletePlus("dn")
CompletePlus("rnorm(10, me")
Run the code above in your browser using DataLab