jonkeane commented on a change in pull request #10343:
URL: https://github.com/apache/arrow/pull/10343#discussion_r640923818
##########
File path: r/R/chunked-array.R
##########
@@ -57,6 +57,25 @@
#' @rdname ChunkedArray
#' @name ChunkedArray
#' @seealso [Array]
+#' @examples
+#' # Pass items into chunked_array as separate objects to create chunks
+#' class_scores <- chunked_array(c(87, 88, 89), c(94, 93, 92), c(71, 72, 73))
+#' class_scores$num_chunks
+#'
+#' # When taking a Slice from a chunked_array, chunks are preserved
+#' class_scores$Slice(2,length = 5)
Review comment:
```suggestion
#' class_scores$Slice(2, length = 5)
```
##########
File path: r/R/type.R
##########
@@ -57,6 +57,13 @@ FLOAT_TYPES <- c("float16", "float32", "float64",
"halffloat", "float", "double"
#' @param x an R vector
#'
#' @return an arrow logical type
+#' @examples
+#' type(1:10)
+#' type(1L:10L)
+#' type(c(1,1.5,2))
Review comment:
```suggestion
#' type(c(1, 1.5, 2))
```
##########
File path: r/R/chunked-array.R
##########
@@ -57,6 +57,25 @@
#' @rdname ChunkedArray
#' @name ChunkedArray
#' @seealso [Array]
+#' @examples
+#' # Pass items into chunked_array as separate objects to create chunks
+#' class_scores <- chunked_array(c(87, 88, 89), c(94, 93, 92), c(71, 72, 73))
+#' class_scores$num_chunks
+#'
+#' # When taking a Slice from a chunked_array, chunks are preserved
+#' class_scores$Slice(2,length = 5)
+#'
+#' # You can combine Take and SortIndices to return a ChunkedArray with 1
chunk
+#' # containing all values, ordered.
+#' class_scores$Take(class_scores$SortIndices(descending = TRUE))
+#'
+#' # If you pass a list into chunked_array, you get a list of length 1
+#' list_scores <- chunked_array(list(c(9.9, 9.6, 9.5), c(8.2,8.3,8.4), c(10.0,
9.9, 9.8)))
Review comment:
```suggestion
#' list_scores <- chunked_array(list(c(9.9, 9.6, 9.5), c(8.2, 8.3, 8.4),
c(10.0, 9.9, 9.8)))
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]