Learn R Programming

chatAI4R (version 0.3.6)

searchFunction: Search R Functions based on Text

Description

Searches for an R function related to the provided text either through the RStudio editor selection or clipboard.

Usage

searchFunction(
  Summary_nch = 100,
  Model = "gpt-4o-mini",
  SelectedCode = TRUE,
  verbose = TRUE,
  SlowTone = FALSE
)

Value

Console output of the identified R function, its package, and a brief description.

Arguments

Summary_nch

Numeric, number of characters to limit the function description (default = 100).

Model

String, the model used for the search, default is "gpt-4o-mini".

SelectedCode

Logical, whether to get text from RStudio selection (default = TRUE).

verbose

Logical, whether to print the results verbosely (default = TRUE).

SlowTone

Logical, whether to slow down the print speed for readability (default = FALSE).

Author

Satoshi Kume

Details

Search the R function based on the provided text

This function searches for an R function that corresponds to the text provided either through the RStudio editor selection or the clipboard. It fetches the related R function and outputs its name, package, and a brief description. The function uses GPT-4 for its underlying search.

Examples

Run this code
if (FALSE) {
# To search for an R function related to "linear regression"
searchFunction(Summary_nch = 50, SelectedCode = FALSE)
}

Run the code above in your browser using DataLab