Can you read specific columns using the readxl package

Hello, I want to copy data from an excel spreadsheet into r. But I don't want to copy all of the columns I want to miss one out.

data <- read_excel("Sample data.xlsx", range = "b3:e103")
^^ using 'range = ()' I can read the whole of my excel spreadsheet. However I want to read the data in columns B, C and E, Skipping the data in column D.

I believe you can only specify rectangular cell ranges in read_excel(). But you could always drop the data of column D from your tibble after reading it in.

Ah yes that works! I've used the select() function from the 'tidyverse' package.

1 Like

This topic was automatically closed 7 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.