-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
50 lines (35 loc) · 2.35 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# buggy <a href="https://simonpcouch.github.io/buggy/"><img src="man/figures/logo.png" align="right" height="200" alt="buggy website" /></a>
<!-- badges: start -->
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://CRAN.R-project.org/package=buggy)
[](https://github.com/simonpcouch/buggy/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The goal of buggy is to help users understand and address error messages using LLMs. With the tool enabled, errors raised to the user are accompanied by clickable links to "explain" or "fix" the issue. Explanations are printed to the console while fixes implement changes directly; in both cases, the model is supplied context about the files you're working in and the functions you're working with.
## Installation
You can install the development version of buggy like so:
``` r
pak::pak("simonpcouch/buggy")
```
To enable buggy, call `buggy::buggy_enable()`. To always have buggy enabled every time you start R, you could add `buggy::buggy_enable()` to your `.Rprofile`, perhaps with `usethis::edit_r_profile()`.
## Example
In the following example, I make a mistake when plotting mtcars:
```{r}
#| echo: false
#| fig-alt: "A screencast of a Positron session. A script called example.R is open in the editor with some ggplot2 lines, one of which will cause an error. Running the code results in both an error and a note Click to explain or fix the last error."
knitr::include_graphics("https://github.com/user-attachments/assets/07353a36-d760-4216-a5ab-eaa953338a99")
```
Upon seeing the error, I click the "explain" link and, after wrapping my head around the issue, allow the model to "fix" it. Once the model fixes the code, it runs correctly.
## Thanks
I’d tossed this package idea around with various folks over the last few months before deciding to give it a go: namely, Barret Schloerke and Joshua Yamamoto.