Rapidly find the mean of survey questions

Following on from the last blog post, I’ve got quite a nice way of generating lots of means from a survey dataset. This one relies on the fact that I’m averaging questions that go 2.1, 2.2, 2.3, and 3.1, 3.2, 3.3, so I can look for all questions that start with “2.”, “3.”, etc. library(tidyverse) survey <- survey %>% bind_cols( map(paste0(as.character(2 : 9), "."), function(x) { return_value <- survey %>% select(starts_with(x)) %>% rowMeans(.

Converting words on a survey dataset to numbers for analysis

As always, I have very little time for blogging (sorry) but I just came up with a neat way of converting “Strongly Agree”, “Always”, all that stuff that you get on survey based datasets into numbers ready for analysis. It’s automatic, so it will play havoc with any word based questions- analyse them in a separate script. Here it is library(tidyverse) survey <- map_df(survey, function(x) { if(sum(grepl("Agree", unlist(x), ignore.case = TRUE)) > 0) { return(case_when( x == "Strongly agree" ~ 10, x == "Agree" ~ 7.

Decade round up post

I’ve got into the habit of writing a yearly roundup blog post (see this blog, passim), based on a suggested framework by David Allen. Since this is the end of a decade I thought it would be fun to do one for the whole decade. Physical Regular readers will know that as far as physical goes I have spent most of the decade getting progressively sicker with two different diseases, beating both, and then having complications from the liver transplant that saved me from the first one.

My superpower (a talk I gave about being ill)

So this post is nothing to do with R, or Linux, or statistics, or any of the usual stuff. It’s about me. It’s more than possible that you’re not very interested in that so consider yourself warned. Long time readers will know I’ve had some pretty serious health problems over the years. I haven’t really talked about it much on here. To be honest I was frightened that people might be put off working with me if they thought I would be off sick a lot and I was also frightened at one point that I might actually be permanently unable to work if the liver disease wasn’t treatable.

NHS-R conference

So I recently just got back from the NHS-R community conference, which was amazing of course, and it’s got me in the mood to share, so I’m writing a few blog posts. I’ve got some more in depth stuff to say about where I think NHS-R is/ should be going, but this is the “feels” one. As I mentioned on Twitter, I love the NHS and I love R so I’m obviously going to enjoy the NHS-R conference.

Authenticating using LDAP from Active Directory using Shiny Server Pro

Right, I promised I would write this a very long time ago and I still haven’t done it. I’ve just got back from the NHS-R community conference (see an upcoming post) and I’m in a sharing mood, and besides someone just asked me about this on Twitter. So setting up LDAP based authentication on Shiny Server Pro via Windows Active Directory. Do note that this post is about using Active Directory.

Add label to shinydashboard

I feel like I’m sticking my neck out a bit here, and there’s a simple way to doing this that I haven’t found, but I’ve looked pretty hard and “add label to sidebar shiny dashboard” has basically no Google juice at all, and I should know because I’ve been staring at it for half an hour. Sometimes you want to add a simple, static label to a shinydashboard sidebar. If you just add it with p() it isn’t aligned nicely with the rest of the sidebar controls.

The analysts' manifesto

I was at an event a little while ago and there was talk of change coming for healthcare analysts. With the advent of population health management we were going to finally get the recognition we as a profession deserve and would get the training and tools necessary to deliver the improvements we all know that data can give. I put my hand up and said, in essence, we’ve heard it all before and I’ll believe it when I see it.

Python, working together, and productionising code at Nottinghamshire Healthcare NHS Trust

Someone just asked me a question on Twitter and I was most of the way through what would have been several tweets before I thought perhaps it would work better as a blog post. I’m going to answer the question first, and then talk some more about the context and what I’m hoping to achieve where I am and (with the advent of more collaborative working through the ICS) in the wider system.

A note for Kindle readers of my Shiny book

Someone has been in touch with me to say that the Kindle version has no chapter numbers and they were finding it difficult to figure out which bit of the book went with which bit in the repository. I’ve made a little video just to run through all the chapters and which code file goes with which bit of the book. While I was doing it I noticed the minimal example from chapter 2 is missing.