As an excel workbook is a binary file, I think you need to download the file before reading. But I may be wrong...
However, you can do this without manualy downloading the file. This can be done in a tempfile and you can add in a wrapper
loadWorkbook_url <- function(url) {
temp_file <- tempfile(fileext = ".xlsx")
download.file(url = url, destfile = temp_file, mode = "wb", quiet = TRUE)
loadWorkbook(temp_file)
}
This is what other
for dealing with excel in R can do:
-
See openxlsx that can read from a url with read.xlsx, using this technic internaly (see Github source for internal getFile function)
-
in readxl, this is still a feature in thinking
As your file is on a github private repo, you may need to create your custom wrapper using httr::write_disk to write on disk, in the tempfile, the result of your GET that uses the API key.
If I find a demo file in a github repo, I will provide an exemple.