Rename a (work)sheetSource:
Changes the name of a (work)sheet.
Something that identifies a Google Sheet:
its file id as a string or
a URL from which we can recover the id
dribble, which is how googledrive represents Drive files
an instance of
googlesheets4_spreadsheet, which is what
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.
ss, as an instance of
ss <- gs4_create( "sheet-rename-demo", sheets = list(cars = head(cars), chickwts = head(chickwts)) ) #> ✔ Creating new Sheet: sheet-rename-demo. sheet_names(ss) #>  "cars" "chickwts" ss %>% sheet_rename(1, new_name = "automobiles") %>% sheet_rename("chickwts", new_name = "poultry") #> ✔ Renaming sheet cars to automobiles. #> ✔ Renaming sheet chickwts to poultry. # clean up gs4_find("sheet-rename-demo") %>% googledrive::drive_trash() #> File trashed: #> • sheet-rename-demo <id: 1pEc_BIUwDP5G0Kc0UHonObNgVVupDWL_xVmI3R-NIjU>