You can create a custom function format.data.frame with changes in behavior when R finds "long" names:
long <- nchar(cn, "bytes") > 256L cn[long] <- paste(substr(cn[long], 1L, 250L), "...") names(rval) <- cn
And since dataframs print as matrices after all this preprocessing, it is hoped that print.default (in fact, common print.default ) handles escape characters like cat does (print as is to get a new line when printing \n ) .
Edit Actually, print.default hides non-printable characters (online cat help page)
Character strings are printed "as is" (unlike print.default, which escapes non-printable characters and backslash [...])
So, you should start preparing your own method (also, check the parameters when converting R objects to $$ \ LaTeX $$ tables, maybe there is an option).
Oscar de León
source share