Is it possible to generate a list of sheetnames within an xlsx file? Or perhaps, can I check if a sheet name exists, and if not, proceed with some designated function?
With xlsx library you can get the list of the sheets in an existing workbook with getSheets():
wb <- loadWorkbook(your_xlsx_file)
sheets <- getSheets(wb)