title: Getting application ID from SparkR to create Spark UI url
body: <p>From the SparkR shell, I'd like to generate a link to view the Spark UI while in Yarn mode.  Normally the Spark UI is at port 4040, but in Yarn mode apparently it is at something like <code>[host]:9046/proxy/application_1234567890123_0001/</code>, where the last part of the path is the unique applicationId.</p>
  
  <p>Other SO answers show how to get the applicationID for the <a href="https://stackoverflow.com/a/28703835/1344789">Scala</a> and <a href="https://stackoverflow.com/posts/30984465/edit">Python</a> shells.  How do we get the applicationID from SparkR?</p>
  
  <p>As a stab in the dark I tried <code>SparkR:::callJMethod(sc, "applicationId")</code>, but it didn't work.</p>
  
  <p>I also tried something along the lines of <code>system("yarn application -list")</code>, but that doesn't seem to work from RStudio and has other limitations.</p>