Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor documentation inaccuracies #1926

Open
khusmann opened this issue Apr 9, 2024 · 0 comments
Open

minor documentation inaccuracies #1926

khusmann opened this issue Apr 9, 2024 · 0 comments

Comments

@khusmann
Copy link

khusmann commented Apr 9, 2024

Thanks again for this awesome library! I can tell y'all really value your docs, so I wanted to relay some minor (afaikt) inaccuracies I found in the documentation while learning the library that caused me brief confusions:


  1. This should be vec_proxy_equal(), not vec_proxy() right?

#' * ==, !=, unique(), anyDuplicated(), and is.na() use
#' [vec_proxy()].

https://github.com/r-lib/vctrs/blob/8bf5ba59bae73705f460ef326b725023cff46efa/R/type-vctr.R#L39C1-L40C20


  1. For bare a vctrs_vctr, quantile() and median() are not implemented.

#' * <, <=, >=, >, min(), max(), range(), median(),
#' quantile(), and xtfrm() methods use [vec_proxy_compare()].

https://github.com/r-lib/vctrs/blob/8bf5ba59bae73705f460ef326b725023cff46efa/R/type-vctr.R#L42C1-L43C68


  1. vctrs doesn't provide a vec_arith.double() or vec_arith.integer() S3 generic... it actually only provides vec_arith.numeric() and vec_arith.logical()

vctrs provides the hybrid S3 generics/methods for most of the base R types, like vec_arith.integer().
If you don't fully import vctrs with @import vctrs, then you will need to explicitly import the generic you are registering double dispatch methods for with @importFrom vctrs vec_arith.integer.

https://github.com/r-lib/vctrs/blob/8bf5ba59bae73705f460ef326b725023cff46efa/vignettes/s3-vector.Rmd#L1317C1-L1319C1


  1. The documentation for vec_slice() says it will slice the proxy (if available) and then vec_restore(). But in type-rcrd.R there's this definition:
`[[.vctrs_rcrd` <- function(x, i, ...) {
  out <- vec_slice(vec_data(x), i)
  vec_restore(out, x)
}

Does that mean the calls to vec_data() and vec_restore() are technically unnecessary here? Or is there some other magic I'm missing that makes it necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant