To display all columns of a dataframe in R, you can use the options
function to increase the max.print
value. This value specifies the maximum number of printed output lines, so increasing it will show more columns of the dataframe.
main.r166 chars7 lines
This will output:
main.r61 chars5 lines
Note: Setting the max.print
value to Inf
may not be practical for large dataframes, as it can consume a lot of memory and slow down your R session. In those cases, you may want to selectively choose which columns to display or use other data manipulation functions like subset
or dplyr
to manipulate your data.
gistlibby LogSnag