Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

395
Visualizações
In R and using Plotly how can I extract the dataframe related to the zoom-in tool?

This my code:

library(gapminder)

ggplotly(ggplot(gapminder %>% filter(country == "Chile")) + aes(x = year, y = pop) + geom_line())

Then I use the zoom in tool:

enter image description here

Then I have this output:

enter image description here

My question is: How can I access/extract the dataframe related to this output?

Any help ?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I guess you need this: We can do it with crosstalk:

enter image description here

library(DT)
library(plotly)
library(crosstalk)
library(gapminder)

options(persistent = FALSE)

my_data <- SharedData$new(gapminder %>% filter(country == "Chile"))

my_plot <- plot_ly(my_data, x = ~ year, y = ~ pop, type = 'scatter', mode = 'lines') %>%
  add_markers(alpha = 0.5) %>%
  highlight(on = "plotly_selected", off = "plotly_deselect", dynamic = TRUE)

my_table <- datatable(my_data)

bscols(widths = c(6, 4), my_plot, my_table)
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda