Hi all, I believe I have either found a small bug, or a possible inconsistency in documentation. formatC() returns a length 1 result if given a length 0 character() as input.
formatC(character()) #> [1] "" But the return value documentation states that it returns: "A character object of same size and attributes as x". I'd love for this to return a size 0 result here, consistent with the docs and my mental model of size stability for this function. Here is where this happens (it is explicitly hard coded): https://github.com/wch/r-source/blob/79298c499218846d14500255efd622b5021c10ec/src/library/base/R/format.R#L149 Thanks, Davis Vaughan [[alternative HTML version deleted]] ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel