Select data columns to display

It would be wonderful to be able to limit/choose the data columns to display in the data viewer window. If you have big data and lots of columns but you need to examine cases, it's cumbersome to scroll to the column you need. Basically, just the same as the "filter" function, but have it able to filter in or out specific columns,

Thanks for all you do

Hi, you can select the columns that you want to view.

There are some Base R and dplyr examples here: dplyr <-> base R (r-project.org)

Maybe I wasn't clear enough. I'm talking only about the data viewer window in Rstudio, not what the console displays.

Something like

foo <- df |> select(column1Iwant, column2Iwant)
View(foo)

there is also select function in dplyr.
you can always select some columns into a different dataframe:

r new_df <- df %>% select( column_a1 , ..., column_an)

it will create a new dataframe with only the selected columns.

This is the RStudio feature request thread, correct? I know how to do those bits of coding. What I'm asking for is a feature in Rstudio that allows you within the data viewer tab to do essentially what the "hide columns" functionality in Excel does. To be more precise, currently when you click on a dataframe that's loaded in your environment, it opens as a tab in the source pane where you can scroll up and down or even use the Filter (hourglass icon) button to filter your values. But it's not possible (that I know of) to hide columns. You can change their width a bit, but that's it. I think the best solution would be something like a horizontal hourglass icon in the upper left corner of the tab. When you click on it all the column names appear and you can select/deselect by name, vector type, etc, essentially all the things you can do with dplyr::select.

Formal raising, and tracking of issues (bugs & feature requests) is done on this other forum:
Issues ยท rstudio/rstudio (github.com)

Roger that, I'll repost there. Thank you

there is also select function in dplyr..
.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.