Skip a column

Use this function to ignore a column when reading in a file. To skip all columns not otherwise specified, use cols_only().

See Also

Other parsers: cols_condense, cols, parse_datetime, parse_factor, parse_guess, parse_logical, parse_number, parse_vector

  • col_skip
Documentation reproduced from package readr, version 1.3.1, License: GPL (>= 2) | file LICENSE

Community examples at Jan 21, 2019 readr v1.1.1

**Skip the index column when reading a dataframe** [Data Source]( When I try to read the data only giving the filename, the first column is only an index list which I don't need. To prevent it from happening, we need to use `col_types` parameter to specify the columns we want to skip. `X1` refers to the first column. Likewise, if you want to skip the 5th column for example, you need to use `X5`. To add more columns to skip, simple add another line of `Xn = col_skip()` separated with a comma within `cols`. ```r library(tidyverse) <- read_csv("wineQualityWhites.csv", col_types = cols(X1 = col_skip())) colnames( ``` The code below gives the same result: ```r <- read_csv("wineQualityWhites.csv") %>% select(2:13) colnames( ``` [Source](