0
我在Excel文件中有銷售數據,因此必須在工作表3中打開。我嘗試了下面的代碼,但無法給超鏈接到sheet3。如何在R中使用超鏈接打開工作表
library(xlsx)
wb <- createWorkbook()
sheet1 <- createSheet(wb, "Sheet1")
rows <- createRow(sheet1)
cells <- createCell(rows)
links <- c("[D://r datasets/sales data.xlsx]sheet3!")
names(links) <- c("link1")
for (row in 1:length(links)) {
setCellValue(cells[[row,1]], names(links)[row])
addHyperlink(cells[[row,1]], links[row])
}
saveWorkbook(wb, "hyperlinks to file.xlsx")
shell.exec("hyperlinks to file.xlsx")
任何人都可以在這方面幫助嗎?
還問[這裏](http://stackoverflow.com/questions/36663377/how-to-create-hyperlinks-in-r-to-move-to-the - 下表/ 37260587) – lukeA