Skip to content

Commit

Permalink
various R CMD check NOTE fixes
Browse files Browse the repository at this point in the history
* global variables
* escaped special LaTeX characters
* man-roxygen at top-level
* example URLs beyond max character width
  • Loading branch information
simonpcouch committed Oct 15, 2024
1 parent 2103c43 commit 6508ef2
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 19 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ inst/figs/
^pkgdown$
.env
inst/slides/
man-roxygen
4 changes: 2 additions & 2 deletions R/doc-pal-cli.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#' receives, so we'll call that 100 output tokens per refactor.
#'
#' As of the time of writing (October 2024), the default pal model Claude
#' Sonnet 3.5 costs \\$3 per million input tokens and $15 per million output
#' Sonnet 3.5 costs $3 per million input tokens and $15 per million output
#' tokens. So, using the default model,
#' **cli pals cost around \\$15 for every 1,000 refactored pieces of code**. GPT-4o
#' **cli pals cost around $15 for every 1,000 refactored pieces of code**. GPT-4o
#' Mini, by contrast, doesn't tend to get cli markup classes right but _does_
#' return syntactically valid calls to cli functions, and it would cost around
#' 75 cents per 1,000 refactored pieces of code.
Expand Down
4 changes: 2 additions & 2 deletions R/doc-pal-roxygen.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#' documentation, so we'll call that 200 output tokens per refactor.
#'
#' As of the time of writing (October 2024), the default pal model Claude
#' Sonnet 3.5 costs \\$3 per million input tokens and $15 per million output
#' Sonnet 3.5 costs $3 per million input tokens and $15 per million output
#' tokens. So, using the default model,
#' **roxygen pals cost around \\$4 for every 1,000 generated roxygen documentation
#' **roxygen pals cost around $4 for every 1,000 generated roxygen documentation
#' entries**. GPT-4o Mini, by contrast, doesn't tend to infer argument types
#' correctly as often and
#' often fails to line-break properly, but _does_ usually return syntactically
Expand Down
4 changes: 2 additions & 2 deletions R/doc-pal-testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#' receives, so we'll call that 100 output tokens per refactor.
#'
#' As of the time of writing (October 2024), the default pal model Claude
#' Sonnet 3.5 costs \\$3 per million input tokens and $15 per million output
#' Sonnet 3.5 costs $3 per million input tokens and $15 per million output
#' tokens. So, using the default model,
#' **testthat pals cost around \\$4 for every 1,000 refactored pieces of code**. GPT-4o
#' **testthat pals cost around $4 for every 1,000 refactored pieces of code**. GPT-4o
#' Mini, by contrast, doesn't tend to get many pieces of formatting right and
#' often fails to line-break properly, but _does_ usually return syntactically
#' valid calls to testthat functions, and it would cost around
Expand Down
2 changes: 1 addition & 1 deletion R/pal-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
## usethis namespace: end
NULL

utils::globalVariables(c(".pal_last", "modifyList"))
utils::globalVariables(c(".pal_last", "file.edit", "modifyList"))

# address "not imported from" R CMD check error
#' @importFrom elmer content_image_file
Expand Down
17 changes: 14 additions & 3 deletions R/prompt.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,24 @@
#'
#' # pull prompts from files on local drives or the web with
#' # `prompt_new(contents)`. for example, here is a GitHub Gist:
#' # https://gist.githubusercontent.com/simonpcouch/daaa6c4155918d6f3efd6706d022e584/raw/ed1da68b3f38a25b58dd9fdc8b9c258d58c9b4da/summarize-prefix.md
#' # paste0(
#' # "https://gist.githubusercontent.com/simonpcouch/",
#' # "daaa6c4155918d6f3efd6706d022e584/raw/ed1da68b3f38a25b58dd9fdc8b9c258d",
#' # "58c9b4da/summarize-prefix.md"
#' # )
#' #
#' # press "Raw" and then supply that url as `contents`:
#' # press "Raw" and then supply that URL as `contents` (you don't actually
#' # have to use the paste0() to write out the URL--we're just keeping
#' # the characters per line under 80):
#' prompt_new(
#' role = "summarize",
#' interface = "prefix",
#' contents = "https://gist.githubusercontent.com/simonpcouch/daaa6c4155918d6f3efd6706d022e584/raw/ed1da68b3f38a25b58dd9fdc8b9c258d58c9b4da/summarize-prefix.md"
#' contents =
#' paste0(
#' "https://gist.githubusercontent.com/simonpcouch/",
#' "daaa6c4155918d6f3efd6706d022e584/raw/ed1da68b3f38a25b58dd9fdc8b9c258d",
#' "58c9b4da/summarize-prefix.md"
#' )
#' )
#'
#' @name prompt
Expand Down
4 changes: 2 additions & 2 deletions man/pal_cli.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/pal_roxygen.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/pal_testthat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions man/prompt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6508ef2

Please sign in to comment.