Help with getTables()


I have an excel workbook which contains few sheets within which we have some tables in different forms. I am interested in saving individual table as individual dataframe. I am trying to use getTables(). This is my first experience with it and I am not sure what I am doing wrong. But the result is character (empty). I was hoping to extract tables within the sheet. Can you please help? Here is what I am doing:

path <- "Data/USA.xlsx"
USA <- createWorkbook(path)

vision <- getTables(USA, sheet = "Vision")

Thanks for your help!

I'd suggest using the readxl package for reading Excel files. There are approaches to handle multiple worksheets.

The readxl website has some illustrative examples that can help you get started.

Thanks Siddharth!
Yes, I can handle multiple sheets, but here I am looking to handle multiple tables within the sheets.

OK, then you might want to have a look at the Sheet Geometry vignette in order to specify ranges of cells to read.

Thank you! I am specifically looking for the usage of getTables() and would like to learn this feature. Otherwise, I am able to do my data wrangling. I am not sure what I am doing wrong in my code above for getTables().

Thanks for trying though!

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