Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

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

## 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)))

## End(Not run)

googlesheets

Manage Google Spreadsheets from R

v0.3.0
MIT + file LICENSE
Authors
Jennifer Bryan [aut, cre], Joanna Zhao [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.