I struggled a bit with this, so I figured I’d leave this here.
Dividing the day of the month by 7 and rounding up would work… if the week started on a Sunday (or whatever day you choose to start the week with).
To account for the shift in days, shift ‘back’ by subtracting the day of week from the day.
I’m pretty mad I had to deal with this, so I’m writing this to save you, the R user who has to deal with a database that contains both Devanagari numbers and Arabic numbers, some effort for this extremely niche use case.
Requires tidyverse, and you’re probably still going to have to re-cast your column types (eg, dates).
Recently, at work, I wanted to make a heatmap showing activity by day. I thought displaying the data as a calendar would be the most useful for other team members. I typed up this tutorial a) as documentation for myself and b) for other people looking to make a similar thing.
Data source looks like:
date n2020-09-01 4
Full disclosure: I don’t actually watch Game of Thrones anymore, but I did read the spoilers up till S8E5.
It had been several weeks since Cersei Lannister had been dethroned. King Aegon Targaryen, formerly known as Jon Snow, was starting to rebuild King’s Landing, but every day brought new headaches. One day, there would be dealing with material shortages due to bandit attacks on supply routes, the next, disputes over who was to repay debts incurred by the previous regime, settling squabbles over which lord now had domain over which territory, and so on and so on.
Aegon had no…
By now, you’ve probably at least heard of the problem of antibiotic resistance. In a nutshell, this is the problem where antibiotics become less effective the more and more we use them. Why is this important? A world without effective antibiotics is also one where many routine and critical medical procedures suddenly become dangerous. Surgeries and chemotherapy that are routine today would become life-threatening — and this doesn’t even begin to address how dangerous untreatable diseases are.
So, we know that this problem is massive and poses a significant and already-tangible threat to humanity. But why is it that we…
The largest ever cholera outbreak is currently ongoing in Yemen. In less than 2 years, over 1 million people have gotten cholera, and over 2,000 have died. For comparison, the devastating Haiti cholera outbreak took 7 years to reach the scale that the Yemen outbreak reached in just 6 months.
I’ve taken data from the Humanitarian Data Exchange (which aggregated WHO situation reports on the outbreak), and put them into an animation, so we can more clearly see the scale of the devastation, as well its its timescale. This animation is only current up until the end of February 2018.
Hospital closures have meant that 1.6 million individuals in communities affected by emergency room closures have to travel, on average, an additional 13.2 km (8.2 mi) to get to the next closest emergency room, making the average straight-line distance for affected populations 25.5 km (15.8mi). This has serious implications for the health of people in these communities.
This KFF brief highlights a big problem — closures of rural hospitals impacts a rural community’s access to healthcare & emergency care. There have been several news stories and such about this topic. However, there’s a distinct lack of quantitative data…
Most people are not fantastic at communicating. Part of good communication is the ability to empathize with the people you’re communicating with, and it turns out that that’s a lot harder than many people let on. After all, how do you empathize with someone whose views appear antithetical to your own? This is a problem, as communication is a cornerstone of public health and your communication skills have an impact on your effectiveness. Today, I’m here to give you ONE SIMPLE TRICK that might help you this process.
One of the most generalizable concepts from business negotiations is the framework…
Lately, I’ve been thinking a lot about Ignaz Semmelweis and what he means for public health. I think that there are a lot of lessons for public health (and science) researchers and communicators, especially in terms of advocacy.
Semmelweis was a physician working in Vienna General Hospital in the 1840s. He was the equivalent of the chief resident in the First Obstetrics Unit, where he learned of a curious phenomenon. Women did not want to give birth in the hospital, under the supervision of the doctors. It was generally understood that you were more likely to die from ‘puerperal fever’…
A public health nerd. I make graphs in R.