Serving RStudio Connect content to logged in and anonymous users

We have our patient feedback dashboard in the open where anyone can see what Nottinghamshire Healthcare NHS Trust’s patients are saying about us. Now I’ve got a Connect licence I thought perhaps I might build another version for our staff where I put stuff that we can’t share- for example the comments of people who click the “I do not wish to share this comment” box.

But I don’t want to build and maintain two versions, that would be hideous, and I was going to put a litte

logged_in <- TRUE

at the top of the one for staff and then just swap the files round but knowing me I’ll do it in a hurry one Friday and accidentally publish the logged in version to everybody. For the benefit of those who are new at this, and indeed for those who are not that new but feel the need to double check it actually works like they think it does before they design the whole system around it (like me), it’s pretty simple.

Just publish one and make people authenticate to it, and publish one in the open. Separate apps, separate links, same code. But add somewhere something like

loggedIn <- reactive({
  } else {


Analyst, analyse thyself

I work in a small (growing) team of data scientists and we’re part of a larger analytic unit which has a focus on innovation in analytics (hence us) and public health methods. We have a pretty broad remit to do interesting and useful stuff and we focus on things that we think are useful (for example, applying data science methods to problems relating to equity of access to services) and things that people ask us to help with.

I’m getting more and more interested in making sure that we offer a good service to everyone across my Trust and that we work on truly useful projects rather than just stuff that comes to us through the networks of staff that we already know (I’ve worked in my Trust for nearly 20 years so I know quite a few people).

We’re all resistant to the idea of having a bureaucratic process to decide what we do because quite often we don’t even do that much, we just give a bit of advice and show them some of their own data and they’re off again, so I think what I would like to aim for is transparency. We won’t audit the stuff coming in but we’ll show what comes out and then people can judge for themselves.

And then I thought “Why am I bothering with all that? Surely this job is about helping people and getting stuff done, not collecting data”. And then I realised a millisecond (as my eldest would say) later that that is exactly what clinicians always say about their data collection! And we make the same arguments back to them that I just made to justify it in the first place. We collect data to make sure that what we are doing is effective and to make sure that it is being distributed fairly and works for everyone.

This is a long way of saying that we’re now thinking about how to capture our activity and present it in a way that follows all the usual rules of data collection- not burdensome, timely, accurate, transparent, all that stuff. I suppose really we need a system that’s transparent to everyone- our partners in the region and the general public, so hopefully I’ll be back with data (unless I get in trouble for even suggesting such a thing, in which case forget I said anything 😆)