Delete cells
Deletes a range of cells and shifts other cells into the deleted area. There are several related tasks that are implemented by other functions:
To clear cells of their value and/or format, use range_clear()
.
To delete an entire (work)sheet, use sheet_delete()
.
To change the dimensions of a (work)sheet, use sheet_resize()
.
range_delete(ss, sheet = NULL, range, shift = NULL)
ss |
Something that identifies a Google Sheet: its file ID, a URL from
which we can recover the ID, an instance of |
sheet |
Sheet to delete, in the sense of "worksheet" or "tab". You can identify a sheet by name, with a string, or by position, with a number. Ignored if the sheet is specified via |
range |
Cells to delete. There are a couple differences between
|
shift |
Must be one of "up" or "left", if specified. Required if |
The input ss
, as an instance of sheets_id
Makes a DeleteRangeRequest
:
Other write functions:
gs4_create()
,
gs4_formula()
,
range_flood()
,
range_write()
,
sheet_append()
,
sheet_write()
if (gs4_has_token()) { # create a data frame to use as initial data df <- gs4_fodder(10) # create Sheet ss <- gs4_create("range-delete-example", sheets = list(df)) # delete some rows range_delete(ss, range = "2:4") # delete a column range_delete(ss, range = "C") # delete a rectangle and specify how to shift remaining cells range_delete(ss, range = "B3:F4", shift = "left") # clean up gs4_find("range-delete-example") %>% googledrive::drive_trash() }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.