I believe it is a bug in RStudio. For a logical/integer/double matrix or array, the display is as expected, but for character it has this behavior. I can reproduce with RStudio 2021.09.1+372 "Ghost Orchid" Release (8b9ced188245155642d024aa3630363df611088a, 2021-11-08) for Windows.