Learn R Programming

chatgpt (version 0.2.3)

comment_code: ChatGPT: Comment Code

Description

ChatGPT: Comment Code

Usage

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

Value

A character value with the response generated by ChatGPT.

Arguments

code

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

Examples

Run this code
if (FALSE) {
cat(comment_code("for (i in 1:10) {\n  print(i ** 2)\n}"))
}

Run the code above in your browser using DataLab