This is an automated email from the ASF dual-hosted git repository.
jonkeane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new c4c4c0b3ec MINOR: [R] Document DictionaryType class (#48657)
c4c4c0b3ec is described below
commit c4c4c0b3ecd61ac9947bd350f77b02b21c4dfe99
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Sun Dec 28 01:02:27 2025 +0900
MINOR: [R] Document DictionaryType class (#48657)
### Rationale for this change
There are a TODO for documentation which result in
https://arrow.apache.org/docs/r/reference/DictionaryType.html
### What changes are included in this PR?
This PR documents `DictionaryType` classes.
### Are these changes tested?
I did not test them as they are documentation changes.
### Are there any user-facing changes?
Yes, it fixes the user facing documentation.
---
r/R/dictionary.R | 29 ++++++++++++++++++++++++++---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/r/R/dictionary.R b/r/R/dictionary.R
index 2e6ef59fe5..19ef5100fc 100644
--- a/r/R/dictionary.R
+++ b/r/R/dictionary.R
@@ -17,15 +17,38 @@
#' @include type.R
-#' @title class DictionaryType
+#' @title DictionaryType class
+#'
+#' @description
+#' `DictionaryType` is a [FixedWidthType] that represents dictionary-encoded
data.
+#' Dictionary encoding stores unique values in a dictionary and uses
integer-type
+#' indices to reference them, which can be more memory-efficient for data with
many
+#' repeated values.
#'
#' @usage NULL
#' @format NULL
#' @docType class
#'
-#' @section Methods:
+#' @section R6 Methods:
+#'
+#' - `$ToString()`: Return a string representation of the dictionary type
+#' - `$code(namespace = FALSE)`: Return R code to create this dictionary type
+#'
+#' @section Active bindings:
+#'
+#' - `$index_type`: The [DataType] for the dictionary indices (must be an
integer type,
+#' signed or unsigned)
+#' - `$value_type`: The [DataType] for the dictionary values
+#' - `$name`: The name of the type.
+#' - `$ordered`: Whether the dictionary is ordered.
+#'
+#' @section Factory:
+#'
+#' `DictionaryType$create()` takes the following arguments:
#'
-#' TODO
+#' - `index_type`: A [DataType] for the indices (default [int32()])
+#' - `value_type`: A [DataType] for the values (default [utf8()])
+#' - `ordered`: Is this an ordered dictionary (default `FALSE`)?
#'
#' @rdname DictionaryType
#' @name DictionaryType