我想知道当我单击单元格 1 表 a (A2、A3 等)时,是否可以设置一个链接,将我重定向到单元格 id1 表 b (A1、B1 等)?
(或者必须更好地创建从第 2,3 行等表 a 到列 A、B 等表 b 的链接)
library(openxlsx)
a <- data.frame("id" = 1:2, "val" = paste0(1:2, "a"))
b <- data.frame("id1" = 1:5, "id2" = 11:15)
sheets <- list(
"a" = "a",
"b" = "b")
wb <- openxlsx::createWorkbook()
addWorksheet(wb, sheets$a)
addWorksheet(wb, sheets$b)
writeData(wb, sheet = sheets$a, x = a, startRow = 1)
writeData(wb, sheet = sheets$b, x = b, startRow = 1)
saveWorkbook(wb, "inst/test/file.xlsx", overwrite = T)