4

I'm trying to use the scholar package to develop a shiny app. It works really well when I run it locally, but I get this warning (and the code doesnt work) when deploying to shinyapps.io:

Warning in get_scholar_resp(url, 5) :
2021-12-04T14:56:08.621126+00:00 shinyapps[5266206]:   194: <Anonymous>
2021-12-04T14:56:08.603929+00:00 shinyapps[5266206]:   Page 404. Please check whether the provided URL is correct.
2021-12-04T14:56:08.610531+00:00 shinyapps[5266206]: Warning: Error in httr::content: is.response(x) is not TRUE

It's not an encoding problem. I'm not sure what's is causing this, if anyone could help it'd be great.

This is an reproducible example:

library(shiny)
library(scholar)
library(dplyr)

ui <- fluidPage(
    titlePanel("Scholar package example"),
    sidebarLayout(
        sidebarPanel(
            textInput(
              'id',
              'Insert scholar id',
              value = 'LBHrWsIAAAAJ'
            ),
            actionButton(
              'search',
              'Plot network'
            )
        ),
        mainPanel(
           plotOutput("network")
        )
    )
)

server <- function(input, output) {
  observeEvent(input$search, {
    output$network <- renderPlot({
      scholar::get_coauthors(input$id) %>% 
        scholar::plot_coauthors()
    })
  })
}
 
shinyApp(ui = ui, server = server)
  • Very nice app. If I use it with my profile I get a plot. But not the co_authors. Network is build with sort year, etc.. – TarJae Dec 04 '21 at 16:10
  • Thank you. We are trying to write an assay regarding the h-index, and the analysis will be much better (even this network) than this one. But first I'm trying to solve the problem with shinyapps, because is really important that we are able to deploy the app so other people can use it. Did you manage to make it work on shinyapps.io? – Araê Souza Dec 05 '21 at 17:47

0 Answers0