OptimizeRcode {chatAI4R}R Documentation

Optimize and Complete R Code

Description

Optimizes and completes the R code from the selected code or clipboard.

Usage

OptimizeRcode(
  Model = "gpt-4-0613",
  SelectedCode = TRUE,
  verbose = TRUE,
  verbose_Reasons4change = FALSE,
  SlowTone = FALSE
)

Arguments

Model

A string specifying the machine learning model to use for code optimization. Default is "gpt-4-0613".

SelectedCode

A boolean indicating whether to get the code from RStudio or the clipboard. Default is TRUE.

verbose

A logical value indicating whether to print the result to the console, default is TRUE.

verbose_Reasons4change

A boolean indicating whether to provide detailed reasons for the changes made. Default is FALSE

SlowTone

A boolean indicating whether to print the output slowly. Default is FALSE.

Details

Optimize and Complete R Code

This function takes a snippet of R code and optimizes it for performance and readability. It uses a machine learning model to generate the optimized code.

Value

A message indicating the completion of the optimization process.

Author(s)

Satoshi Kume

Examples

## Not run: 
#Copy your R code then run the following function.
OptimizeRcode(SelectedCode = FALSE)

## End(Not run)

[Package chatAI4R version 0.2.10 Index]