Learn R Programming

chatAI4R (version 0.3.6)

addRoxygenDescription: Add Roxygen Description to R Function

Description

This function adds a Roxygen description to an R function using the GPT-4 model. It can either take the selected code from RStudio or read from the clipboard.

Usage

addRoxygenDescription(
  Model = "gpt-4o-mini",
  SelectedCode = TRUE,
  verbose = TRUE
)

Value

A message indicating completion if `SelectedCode` is TRUE, otherwise the Roxygen-annotated code is copied to the clipboard.

Arguments

Model

A character string specifying the GPT model to be used. Default is "gpt-4o-mini".

SelectedCode

A logical value indicating whether to use the selected code in RStudio. Default is TRUE.

verbose

Logical flag to indicate whether to display the generated text. Default is TRUE.

Author

Satoshi Kume

Details

Add Roxygen Description to R Function

Examples

Run this code
if (FALSE) {
# Option 1
# Select some text in RStudio and then run the rstudio addins
# Option 2
# Copy the text into your clipboard then execute
addRoxygenDescription(Model = "gpt-4o-mini", SelectedCode = FALSE)
}

Run the code above in your browser using DataLab