googlesheets (version 0.3.0)

cell-specification: Specify cells for reading or writing

Description

If you aren't targetting all the cells in a worksheet, you can request that googlesheets limit a read or write operation to a specific rectangle of cells. Any function that offers this flexibility will have a range argument. The simplest usage is to specify an Excel-like cell range, such as range = "D12:F15" or range = "R1C12:R6C15". The cell rectangle can be specified in various other ways, using helper functions. In all cases, cell range processing is handled by the cellranger package, where you can find full documentation for the functions used in the examples below.

Arguments

See Also

The cellranger package has full documentation on cell specification and offers additional functions for manipulating "A1:D10" style spreadsheet ranges. Here are the most relevant:

See a full list of functions in the cellranger index.

Examples

Run this code
# NOT RUN {
gs_gap() %>% gs_read(ws = 2, range = "A1:D8")
gs_gap() %>% gs_read(ws = "Europe", range = cell_rows(1:4))
gs_gap() %>% gs_read(ws = "Europe", range = cell_rows(100:103),
                     col_names = FALSE)
gs_gap() %>% gs_read(ws = "Africa", range = cell_cols(1:4))
gs_gap() %>% gs_read(ws = "Asia", range = cell_limits(c(1, 5), c(4, NA)))
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace