refactor_code: ChatGPT: Refactor Code

View source: R/refactor_code.R

refactor_codeR Documentation

ChatGPT: Refactor Code

Description

ChatGPT: Refactor Code

Usage

refactor_code(code = clipr::read_clip(allow_non_interactive = TRUE))

Arguments

code

The code to be refactored by ChatGPT. If not provided, it will use what's copied on the clipboard.

Value

A character value with the response generated by ChatGPT.

Examples

## Not run: 
cat(refactor_code("i <- 10\nwhile (i > 0) {\n  i <- i - 1\n  print(i)\n}"))

## End(Not run)


chatgpt documentation built on May 31, 2023, 6:54 p.m.