Learn R Programming

air (version 0.2.2)

howto: Ask OpenAI to write R code for a problem. The answer is written to console and returned as a string.

Description

Ask OpenAI to write R code for a problem. The answer is written to console and returned as a string.

Usage

howto(do, call_api = call_openai)

Value

Invisible character string of R code

Arguments

do

Character string of what you want to do

call_api

Optional function to call another API

Examples

Run this code
# You must provision an OpenAI API key before using this function.
if (FALSE) {
howto("read a csv file")
howto("get last element of a vector")
}

Run the code above in your browser using DataLab