createRfunction {chatAI4R}R Documentation

Create R Function from Selected Text or Clipboard Content and Output into the R Console

Description

This function reads text either from your selected text in RStudio or from the clipboard, interprets it as a prompt, and generates an R function based on the given input. The generated R code is then printed into the source file or the R console with optional slow printing.

Usage

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

Arguments

Model

A character string representing the model to be used. Default is "gpt-4-0613".

SelectedCode

A logical value indicating if the selected text should be used as input. Default is TRUE.

verbose

A logical value indicating if progress should be printed. Default is TRUE.

SlowTone

A logical value indicating if slow printing should be used. Default is FALSE.

Details

Create R Function from Selected Text or Clipboard Content

Value

This function returns the generated R code as a clipboard content if SelectedCode is FALSE.

Author(s)

Satoshi Kume

Examples

## Not run: 

#Copy the idea text of the R function to your clipboard and run this function.
createRfunction(SelectedCode = FALSE)

## End(Not run)

[Package chatAI4R version 0.2.10 Index]