0

How to make , e.g., a logical R object xxx indicating internet environment. If xxx=TRUE then online and if xxx=FALSE then off line.


motivation

I use TeX scripts in Shiny in which internet environment is required.

If off line, then any tex script remains its raw appearance.

Camford Oxbridge
  • 834
  • 8
  • 21
  • There isn’t really a reliable way to test if a machine is “online”, and it would be relatively useless anyway: You don’t actually care whether the user is online; instead, you care whether the user can access your specific online resource. So try to access it, and handle failure gracefully with a timeout. – Konrad Rudolph Jul 21 '19 at 14:53
  • Thank you for reply. I understand your suggestion. But,... I do not know where such web page exist for tex. And how to count the time to access the web page via R. It is difficult for me :-D – Camford Oxbridge Jul 21 '19 at 15:21
  • Such as site *does not exist* for TeX. I’m not sure which web resource you’re trying to access in fact. MatJaX is a JavaScript library that’s present locally once loaded, so you wouldn’t need to test internet connectivity anyway. – Konrad Rudolph Jul 21 '19 at 15:38
  • This might be useful to you, https://stackoverflow.com/questions/5076593/how-to-determine-if-you-have-an-internet-connection-in-r – ealbsho93 Jul 21 '19 at 16:00
  • Thank you for three pearons, I read your comments. Thank you. – Camford Oxbridge Jul 21 '19 at 16:27

0 Answers0