``Please what could be the possible cause, I've been debugging this code for more than 5hrs now, I need help.`
output$network_plot2 <- renderPlot({
progress <- shiny::Progress$new()
progress$set(message = "Correlation Plot", value = 0.2)
on.exit(progress$close())
progress$set(message = "Creating Pairwise words", value = 0.4)
x <- data.frame(text = sapply(docs(), as.character), stringsAsFactors = FALSE)
x$tweet_nbr <- 1:nrow(x)
tweet_word <- x %>% unnest_tokens(word, text)
tweet_word_cors <- tweet_word %>% group_by(word) %>% filter(n() >= 50) %>%
pairwise_cor(word, tweet_nbr, sort = TRUE, upper = FALSE)
progress$set(detail = "Plotting..", value = 0.8)
set.seed(1234)
tweet_word_cors %>%
filter(correlation > .6) %>%
graph_from_data_frame() %>%
ggraph(layout = "fr") +
geom_edge_link(aes(edge_alpha = correlation, edge_width = correlation), edge_colour = "royalblue") +
geom_node_point(size = 5) +
geom_node_text(aes(label = name), repel = TRUE,
point.padding = unit(0.2, "lines")) +
theme_void()
})
Hi,
Issues with Shiny code can stem from both the reactive Shiny code itself or the regular R code used in the functions. In order for us to help you with your question, please provide us a minimal reproducible example (Reprex) where you provide a minimal (dummy) dataset and code that can recreate the issue. One we have that, we can go from there.
I suggest you first try to figure out if the issue is with the R or Shiny. Try and run the R code with some sample data line by line and see if it produces the error (replacing any Shiny variables by regular ones). If not, it might be Shiny related.
For help on creating a Reprex, see this guide:
Shiny issues can be challenging to resolve relative to other problems with your code or statistical methods. Shiny apps are often large, complex projects with interacting files.
When seeking help from others it is considered polite to:
First, do your best to work through RStudio's debugging tools to diagnose your issue on your own. Often those shiny logs and tracebacks are useful to others trying to help out.
Second, strive to minimize the effort required to replicate your issue. You can do this with a reproducible example ("reprex").
Shiny Debugging
Errors in Shiny code can be difficult to track down. If you don't know where your problem is coming from, you can track it down with some o…
Good luck!
PJ
Thanks. problem has been solved.
system
Closed
October 20, 2020, 9:59pm
4
This topic was automatically closed 54 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.