Changes the name of a (work)sheet.

sheet_rename(ss, sheet = NULL, new_name)



Something that identifies a Google Sheet: its file ID, a URL from which we can recover the ID, an instance of googlesheets4_spreadsheet (returned by gs4_get()), or a dribble, which is how googledrive represents Drive files. Processed through as_sheets_id().


Sheet to rename, in the sense of "worksheet" or "tab". You can identify a sheet by name, with a string, or by position, with a number. Defaults to the first visible sheet.


New name of the sheet, as a string. This is required.


The input ss, as an instance of sheets_id

See also


if (gs4_has_token()) { ss <- gs4_create( "sheet-rename-demo", sheets = list(iris = head(iris), chickwts = head(chickwts)) ) sheet_names(ss) ss %>% sheet_rename(1, new_name = "flowers") %>% sheet_rename("chickwts", new_name = "poultry") # clean up gs4_find("sheet-rename-demo") %>% googledrive::drive_trash() }
#> Creating new Sheet: "sheet-rename-demo"
#> Renaming sheet "iris" to "flowers"
#> Renaming sheet "chickwts" to "poultry"
#> Files trashed: #> * sheet-rename-demo: 16ItB4tR81y2qQOZ9-esRCznU2gmS17df0DDA3pLEgXc