возможно ли написать код ниже с пакетом openxlsx? я застрял в строке createRow, так как я думаю, что openxlsx не имеет этой функции.
library(xlsx)
linkname = data.frame(fulllist=c("First","Second","Third","Fourth","Fifth"), hyplink=c("http://first.com/","http://second.com","http://third.com","http://fourth.com","http://fifth.com"),stringsAsFactors = F)
wb <- createWorkbook()
sheet1 <- createSheet(wb, "Sheet1")
rows <- createRow(sheet1, seq_along(linkname$hyplink))
rows <- createRow(sheet1, 1:5)
cells <- createCell(rows, colIndex=1:2) # 2 columns
for (i in seq_along(cells[,1])){
col1 <- cells[[i,1]]
setCellValue(col1, linkname$fulllist[i])
addHyperlink(col1,linkname$hyplink[i])
col2 <- cells[[i,2]]
setCellValue(col2,linkname$fulllist[i])
}
saveWorkbook(wb, "C:/Users/K/Downloads/test.xlsx")