| hal_ask | R Documentation |
Pipe mode: a pipe-terminal verb that sends a prompt to Copilot augmented
with the piped data context. The piped object is described via str() and
attached to the prompt. Returns .data invisibly (pipe passthrough).
hal_ask(.data, ...)
.data |
In pipe mode: an R object (data frame, model, etc.) piped in. In standalone mode: the first prompt string. |
... |
Character strings forming the prompt. |
Standalone mode: called directly with a string prompt to ask a question without data context. Returns the response text invisibly.
Spawns a disposable session – does NOT pollute the main hal() conversation.
Pipe mode: invisibly returns .data (pipe passthrough).
Standalone: invisibly returns the response text.
## Not run:
# Pipe mode (data-aware analysis)
mtcars |> hal_ask("what are the key patterns?")
lm(mpg ~ wt, data = mtcars) |> hal_ask("interpret these coefficients")
# Standalone mode (general question)
hal_ask("what does the pipe operator do in R?")
hal_ask("explain", "the difference between <- and =")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.