Skip to content

Commit 2d383bf

Browse files
committed
docs + spelling
1 parent 7da7ce0 commit 2d383bf

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

r/R/vctr.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,30 @@
1717

1818
#' Experimental Arrow encoded arrays as R vectors
1919
#'
20+
#' This experimental vctr class allows zero or more Arrow arrays to
21+
#' present as an R vector without converting them. This is useful for arrays
22+
#' with types that do not have a non-lossy R equivalent, and helps provide an
23+
#' intermediary object type where the default conversion is prohibitively
24+
#' expensive (e.g., a nested list of data frames). These objects will not
25+
#' survive many vctr transformations; however, they can be sliced without
26+
#' copying the underlying arrays.
27+
#'
28+
#' The nanoarrow_vctr is currently implemented similarly to `factor()`: its
29+
#' storage type is an `integer()` that is a sequence along the total length
30+
#' of the vctr and there are attributes that are required to resolve these
31+
#' indices to an array + offset. Sequences typically have a very compact
32+
#' representation in recent version of R such that this has a cheap storage
33+
#' footprint even for large arrays. The attributes are currently:
34+
#'
35+
#' - `schema`: The [nanoarrow_schema][as_nanoarrow_schema] shared by each chunk.
36+
#' - `chunks`: A `list()` of `nanoarrow_array`.
37+
#' - `offsets`: An `integer()` vector beginning with `0` and followed by the
38+
#' cumulative length of each chunk. This allows the chunk index + offset
39+
#' to be resolved from a logical index with `log(n)` complexity.
40+
#'
41+
#' This implementation is preliminary and may change; however, the result of
42+
#' `as_nanoarrow_array_stream(some_vctr[begin:end])` should remain stable.
43+
#'
2044
#' @param x An object that works with [as_nanoarrow_array_stream()].
2145
#' @param subclass An optional subclass of nanoarrow_vctr to prepend to the
2246
#' final class name.

r/man/as_nanoarrow_vctr.Rd

Lines changed: 25 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

r/src/materialize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ SEXP nanoarrow_materialize_finalize_result(SEXP converter_xptr, SEXP result) {
311311
SEXP chunks_tail_sym = PROTECT(Rf_install("chunks_tail"));
312312
Rf_setAttrib(result, chunks_tail_sym, R_NilValue);
313313

314-
// We also want to pass on the class of the ptype we recieved
314+
// We also want to pass on the class of the ptype we received
315315
SEXP subclass_sexp = Rf_getAttrib(result, R_ClassSymbol);
316316

317317
// We no longer need the first element of the pairlist, which was

0 commit comments

Comments
 (0)