Issue: I need to read in excel workbook Notes/Comments for data cells as their own data column in R.

I have found my way to the Tidyxl package, but I cannot get the script to work when I'm loading the data.
I have started a GitHub thread to reference for input data, Rscript, & what I hope the end product will look like:
Melunome/Excel-Notes-Comments-into-R
The xlsx package supports this as well.
library(xlsx)
library(tidyverse)
wb <- xlsx::loadWorkbook(file = 'test_data_30oct2020 (1).xlsx')
sheets <- getSheets(wb)
sheet <- sheets[[1]]
rows <- getRows(sheet)
cells <- getCells(rows)
comments <- lapply(cells, getCellComment)
read_comments <- comments %>%
purrr::discard(is.null)
resp <- vector('list')
for (i in seq_along(read_comments)) {
resp[[i]] <- read_comments[[i]]$getString()
}
resp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With