addRoxygenDescription: Add Roxygen Description to R Function

View source: R/addRoxygenDescription.R

addRoxygenDescriptionR Documentation

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
)

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.

Details

Add Roxygen Description to R Function

Value

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

Author(s)

Satoshi Kume

Examples

## Not run: 
# 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)

## End(Not run)

chatAI4R documentation built on April 4, 2025, 1:06 a.m.