2

I can read in all columns between columns A:O, but this can require indicating many column types that I do not care about.

library(googlesheets4)
library(tidyverse)

gs_ex <- 'https://docs.google.com/spreadsheets/d/<my_long_id>'

gs_raw <- 
  read_sheet(
    gs_ex, 
    sheet = 'Converted', 
    range = 'A:O', 
    col_types = 'cccDccDcDcDccD' # c = character, D = Date
  )

Can I only specify the 3 columns I do care about?

gs_raw <- 
  read_sheet(
    gs_ex, 
    sheet = 'Converted', 
    range = 'A,K,O', # this will not work
    col_types = 'cDD' 
  ) 
Joe
  • 3,217
  • 3
  • 21
  • 37
  • 1
    `range` can only a range of values either numeric or character i.e. `cell_cols` – akrun Sep 20 '21 at 23:37
  • Another potential option is to create a new googlesheet referencing the 3 columns of interest from the sheet using the [IMPORTRANGE function](https://support.google.com/docs/answer/3093340), then import that into R – jared_mamrot Sep 20 '21 at 23:46

0 Answers0