I'm trying to combine three different scatterpolars into a single plot using plotly in R, but it's not working. I ran the following code:
library(plotly)
m13 = runif(6, 0,1)
m15 = runif(6, 0,1)
m17 = runif(6, 0,1)
n = c('Saneamento', 'Riqueza', 'Saúde', 'Longevidade', 'Educação', 'Crime')
plot_ly(type = 'scatterpolar',
mode = 'lines') %>%
add_trace(r = m13,
theta = n,
fill = "toself",
mode = "markers",
name='Índice 2013') %>%
add_trace(r = m15,
theta = n1,
fill = "toself",
mode = "markers",
name='Índice 2015')%>%
add_trace(r = m17,
theta = n2,
fill = "toself",
mode = "markers",
name='Índice 2017')%>%
layout(
polar = list(
radialaxis = list(
visible = T,
range = c(0,1)
)
)
)
%>%
subplot(ncols = 3)
)
It gives me the following plot:
The plot is superimposed. The subplots doesn't seem to work. I need three plots in the same row. How to do this ? I tried something like what is in plotly guide the but it didn't work.
I appreciate any help.
