Goal
Get data in a shiny app and display a radar chart. The data may have multiple columns with different column names (as user names differ).
Example
Here is a simple example with 3 columns that I put in a radar chart:
library(echarts4r)
library(tibble)
data_long <- tibble::tibble(
Construct = c("C", "A", "B"),
radar1 = c(10, 50, 100),
calcu2 = c(50, 90, 5),
foker = c(15, 35, 75)
)
data_long |>
e_charts(Construct) |>
e_radar(radar1, max = 100) |>
e_radar(calcu2) |>
e_radar(foker)
The challenge I have is that the column names other than "Construct" will be user names. So, I would not know the column names beforehand. The e_radar
function requires a column name. How do I programmatically build the radar chart without knowing the number and names of columns?
Maybe you can make a generic e_radar function. You can use
e_radar_()
instead ofe_radar()