0

I have an output with formulas from what I believe to be an Oracle database. It uses multiple indent levels to assign hierarchy levels. These levels are lost when I read the file into R (via CSV or readxl::read_excel, etc).

The screenshot is an example (LibreOffice, but it looks the same in Excel). The formulas states "Sum of children" and these these children follow in the indented list below it (up to, not including SO2). The file from the screenshot can be found here.

How can I pick up these indentation levels in R? (or any other workaround)

enter image description here

Henk
  • 3,634
  • 5
  • 28
  • 54
  • You need to provide an example file. However, I would first go and educate whoever has given this to you on proper data storage and exchange. – Roland Apr 05 '16 at 10:46
  • File added. Would have to educate 50 devs or so. – Henk Apr 05 '16 at 12:12
  • Those seem to be groupings in Excel. I don't know how to get these into R (except maybe unzip the xlsx and parse the xml). 50 devs or not, I would refuse to work with this and let them fix it. It would probably be easier to interface with the database directly. – Roland Apr 05 '16 at 12:55

1 Answers1

1

use xlsx_format function to read indentation in R. there is package called tidyr and unpivotr. Use the following link:- https://www.youtube.com/watch?v=Q_McYaDV9H0