echarts4r icon indicating copy to clipboard operation
echarts4r copied to clipboard

Having problem with e_treemap function

Open 20korando opened this issue 3 years ago • 1 comments

my dataframe looks like this (simplified example)

state / party / number of candidates CA / Dem / 10 CA / Ind / 2 CA / Rep / 1 MN / Dem / 2 MN / Ind / 0 MN / Rep / 8

whenever I run the code df |> e_charts(number of candidates) |> e_treemap(party, state) the error "object "state" not found" appears

my guess is that since there are overlapping values in state(there are dems both in CA and MN) the package fails to read the columns? but I can not edit each values from state, since that is the value name that I want to show... so I am stuck in this situation. can somebody offer some help?

20korando avatar Jun 10 '22 02:06 20korando

The e_treemap()function expects a nested list structure, not just a data frame. Take a look here.

I woul love to help, but I would strongly suggest to give a reproduciple example with real R code. Getting help is much easier that way.

rdatasculptor avatar Jul 01 '22 09:07 rdatasculptor