Shiny error message appears and dissappears immediately - r

Three selectInput options I have in my app. First is Class, second is Select Student and third is Exams. So when I chose class 1 in the 'Class selectInput', all the students name in class 1 is generated in 'Select Student selectInput'.
The error message pops for few seconds and then goes away while choosing the class choices in 'Class selectInput'. This also happens at the time of landing at the page.
Error message is 'data' must be of a vector type, was 'NULL'.
This doesn't happen if I remove the bar plot and render just the table output.
The app is online here. You can see the error message yourself when you switch the Classes.
The code is here.
Any hints gratefully received.

Related

Showing something my text instead of error message text while data is being loaded in shiny

Is that possible to replace an error message text with my own text?
For example, if you go to https://o-canada.shinyapps.io/vitals
you will get to see rather discouraging error message text:
"An error has occurred. Check your logs or contact the app author for clarification"
while the App is loading the data.
Is that possible to suppress this error message so it is not shown to user, and even better to replace it with my own text message like (eg. "Please wait until the data is loaded") ?

telegram.error.BadRequest: Message to edit not found

What kind of event should trigger the functionality?
A user presses an InlineKeyboardButton within the bot itself
What kind of chat is the functionality supposed to work in?
The button is on a message that is from a bot to the user. (i.e inside chat with a bot. NOT in a group/channel)
How do you want your bot to react?
I wish to read the text of the message using text = str(update['callback_query']['message']['text'])
I then wish to edit that message using query.edit_message_text(text=text, reply_markup = keyboard)
What is the problem?
In step 1, that 'text' field is completely missing in the 'Update' dictionary.
As a result, the 'edit_message' in step 2 dont work and throw "Message to edit not found telegram"
The above behavior occurs for posts about 48hours from today. Meaning the inlinebutton works normally first, then after ____ period of time passed, the error described above is observed.
What is my hypothesis?
Telegram side deletes that information and dont allow me to call it after ____ period in time.

How to escape from an update message?

I have following message in Progress-4GL:
DEF VAR L-temp AS CHARACTER.
MESSAGE "Give me information" UPDATE L-temp.
This shows an update message, which is fine, but when I try to escape from that message (e.g. I realise that I have clicked on the wrong button, launching this message), I can't hide that message:
How can I solve this (I simply want to remove the message from screen)?I can't add VIEW-AS ALERT-BOX as alert-boxes only can update logical variables and fields. Or is there a simple Show-Dialogbox() for such a case?
Edit
I tried replacing UPDATE by SET and viewing the whole thing as an alert-box, but this seems not to be allowed up (only logical variables and fields seem to be allowed).
Edit 2
Trying with PROMPT-FOR was not a good idea, because this seems to hide the rest of the window, while I want the message to be shown as some kind of a popup in top of the rest of my window/frame.
Edit 3
Also System-Dialog seems not to be a good idea, because all I want is to get a simple string.
It's a bit unfortunate that the 'close window' button does not by default, close the window. Even when a frame is defined as a modal dialog-box, the window-close event needs to be rerouted to close.
define frame frupdate
cinfo as char label "Give me information" with side-labels
with
title "Message Update"
view-as dialog-box
.
on "window-close" of frame frupdate
apply "close" to frame frupdate.
enable all with frame frupdate.
wait-for close of frame frupdate.

validate message not showing to user anywhere on the screen

My dataframe train_df gets filtered for the inputs that the user provides. After that I use the filtered datframe to run a model. But if user sets the filter too narrow,and there are no points for those filters, I want to show an error message to the user preferably in a modal box(if not then anywhere) that there are no points found for your filters. I use the following code on my server side. 'update' is the input id of my button in the UI
})
observeEvent(input$update,{
shiny::validate(
need(nrow(train_df) > 0, "No points found for these filters!")
)
})
My validate statement works but the error message does not show up in the app. Any help would be appreciated.

webscraping with rvest, select content in form

I am using rvest to web scrape a particular website. On the website I need to select for example the date and the location that I want to display.
library(rvest)
session<-html_session(url)
form<-html_form(read_html(url))[[1]]
I can now set different values e.g. for the date.
set_values(form, from="08.02.2018")
and on the console appears: < input text > 'from': 08.02.2018
as well as for the other element "location": < select > 'location': [0/3]
My question is how I can set the value for "location". I know the different elements of "location" from the manual dropdown. Still:
set_values(form, location="Location_A")
doesn't work. No selection is visible and when submitting the form with
result<-submit_form(session,form)
A red message is on the console (Submitting with 'Location'). The result is an object with class "session", which I wasnt able to read with
html_table(result)
With Error: Error in UseMethod("html_table") :
no applicable method for 'html_table' applied to an object of class "list"
I started with
html_table(result[1])
However, none was working, same error.

Resources