thisisnic commented on a change in pull request #10269: URL: https://github.com/apache/arrow/pull/10269#discussion_r633851616
########## File path: r/R/util.R ########## @@ -110,3 +110,21 @@ handle_embedded_nul_error <- function(e) { } stop(e) } + +#' Take an object of length 1 and repeat it. +#' +#' @param object Object to be repeated - vector, `Scalar`, `Array`, or `ChunkedArray` +#' @param n Number of repetitions +#' +#' @return `Array` of length `n` +#' +#' @keywords internal +repeat_value_as_array <- function(object, n) { + if (length(object) != 1) { Review comment: I think I was trying to make this function a bit more generic in case it's useful elsewhere, but you make a good point; I'll remove the check. -- 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: us...@infra.apache.org