Is there any reason that col.names defaults to FALSE when writing a matrix to the clipboard? There's an explicit check for this in clipr:::table_str:
if (is.matrix(content))
.dots$col.names <- ifelse(is.null(.dots$col.names), FALSE,
.dots$col.names)
I had been working around this by coercing to a data.frame first, though I see I can now just pass col.names = TRUE to clipr::write_clip.
It's presumably too late to change the default, since it may break people's existing code, but it would useful if the default could be set using an option, particularly since this is almost always something that will be used interactively.
Is there any reason that
col.names
defaults to FALSE when writing a matrix to the clipboard? There's an explicit check for this inclipr:::table_str
:I had been working around this by coercing to a
data.frame
first, though I see I can now just passcol.names = TRUE
toclipr::write_clip
.It's presumably too late to change the default, since it may break people's existing code, but it would useful if the default could be set using an option, particularly since this is almost always something that will be used interactively.