Skip to content
Prev 60171 / 63424 Next

formatC(<zero-length>) doesn't keep attributes

By r80949, 'formatC' code in R devel has
? ? if (!(n <- length(x))) return(character())

If 'x' has length zero, the return value of 'formatC' doesn't have attributes. It doesn't follow the documented "Value": "A character object of the same size and attributes as x".

Based on my observation, the early return could be removed.
    n <- length(x)