To link to another sheet, use
addHyperlink(cell, "sheetname!colRow", linkType="DOCUMENT")
For example
library(xlsx)
wb <- createWorkbook()
sheet1 <- createSheet(wb, "Sheet1")
sheet2 <- createSheet(wb, "Sheet2")
rows <- createRow(sheet1, 1:10) # 10 rows
cells <- createCell(rows, colIndex=1:8) # 8 columns
row <- 1
link <- paste0(names(getSheets(wb))[2], "!", "A", row)
setCellValue(cells[[row,1]], "link to other sheet")
addHyperlink(cells[[row,1]], link, linkType="DOCUMENT")
saveWorkbook(wb, "links.xlsx")
shell.exec("links.xlsx")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…