Hi,
Fairly new to Plotly and R in general. I have been building treemaps for a few weeks without any problem but now have to build a nested treemap. My dataframe is made up of 3 columns: Sector, Source and Total CO2 Emissions. There are 9 Sectors and 349 Sources that are divided up into these 9 Sectors. I want to build a treemap that shows the 9 Sectors and when you click on one Sector it shows you which of the 349 Sources are in that Sector. I just canβt figure it out no matter what I try! Any advice would be much appreciated. Attached is a photo of some of the data.
Thanks
Please share the output of dput(your_data_frame)
, so we can work with it.
Or have a look at my answer here:
and replace type='sunburst'
with type='treemap'