Is gdata's read.xls still valid to read an Excel file?

An old R tutorial mention to use

library(gdata)
IrisContent<-read.xls("Iris.xls",sheet=1,header=T)

and running that, on RStudio-2023.12.0-369 using R version 4.3.2, I got

Error in read.xls("Iris.xls", sheet = 1, header = T) :
could not find function "read.xls"

I searched a few pages for an answer ans stumbled on read.xls function - RDocumentation and ran a very slightly modified version of its example

xlsfile <- file.path(path.package('gdata'),'xls','iris.xls')
iris <- read.xls(xlsfile)

and got

Error in read.xls(xlsfile) : could not find function "read.xls"

then I noticed on that page

Warning
Excel file support is deprecated in gdata version 2.19.0, to be removed in the near future.

Can Excel files still be read using gdata, and if so can it be in the same way as in the beginning of this post?

Thank you kindly for your help

link

Changes in 3.0.0 (2023-10-09)
Other changes:
Removed installXLSXsupport(), read.xls(), sheetCount(), sheetNames(),
xls2csv(), xls2tab(), xls2tsv(), xls2sep(), and xlsFormats(). See gdata 2.19.0
NEWS entry announcing their deprecation.

if you want alternatives I like readxl
link

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.