I've got this problem: Read only certain columns from xls
I want to comment on this answer by @R.Prost but I don't have enough reputation:
df <- read_xlsx(path = "filename.xls", sheet = "sheetname", range = cell_cols("A:G"))
This answer specifies the range "A:G" which includes all columns from A to G. I want to select non-adjacent columns only, e.g. only columns A, C and G. I've tried:
df <- read_xlsx(path = "filename.xls", sheet = "sheetname", range = cell_cols(c("A","C","G")))
But no joy, this still reads in A thru G.
I feel like this should be really simple and that I'm doing something silly. How do I read in only A, C and G?