Creating a ProdPad progress report in R

Photo by rawpixel on Unsplash
My journey with writing new R scripts had taken a bit of break recently. It started with exploring Text-mining. Then creating my library of reports for Product Management. Although R takes a bit of getting used to, it is like Excel x100 once you do. It is great for repeatable analysis and report generation. Saving a lot of the hassle of the export, format, and save cycle that I was going through.


The problem

When I needed a new report though I took the chance to expand my skills. I wanted an automated report that showed progress in the product process. This was to show the pipeline to meet strategic goals in the product ideas worked on. This should be in a suitable format to share with senior management. An be understandable especially to those outside the Product team.


The solution

I had been manually noting figures from the ProdPad UI when I remembered that there was an API. I took a look and it is a nice RESTful API with a JSON payload, so easy to integrate with. Checking GitHub and there were a couple of projects for ProdPad, but none doing this kind of reporting. A quick google of "json r" later and I had found and installed a JSON deserialisation package (jsonlite). This created my R objects as from the API call.

I could then pull in the ideas, make a secondary call to get the workflow status and any tags that were applied to the idea. I choose to pick three tags to highlight and create variables for which stream of work each idea applied to. These each then matched to a goal from the strategic plan.

Next I added it to my "R for Product Management" project on GitHub. This was along with some explanation to get started for other users.



Expanding insight

Looking down the lsit of APIs available I then saw feedback - and it was in a similar format to the Twitter feed in the Text-mining example - so I created a word cloud on the past quarter's feedback. This should highlight trends in what people are asking for.

To dig a bit further I then used the topic modelling library. This allows you to find word associations with words from the road map. To try and reveal any insights that might have missed by reading them individually.

This is a very early proof of concept, and likely to change a lot with use and feedback from the team. But is part of my long term plan to be more data-informed, where possible.



Lesson 1: using function files

For the first time I extract my functions into a separate file. My former dev reflexes started kicking in. This meant that my main script process and formatting the ideas and feedback was short and easy to read. It also allowed the work to form part of a dplyr workflow, with standard R functions. I haven't put any tests around it yet, probably need to learn about mocks in testthat.


Lesson 2: knitr and kable

This was also the first time I had many raw data tables that I wanted to display in my Word doc. The plain text output is OK for me exploring in the IDE, but not great for sharing with other stakeholders. Kable doesn't have many options, but as a quick way to look like a Word style table it is perfect.

I did have a little bit of an issue here with two chunks of code producing table with a single line of text in the middle. For some reason it merged both tables and inserted the text into a row, words split across the columns. A few blank lines at the end of the R chunks and around the text seemed to fix that.



I hope that someone out there finds some value in my R scripts. Please feel free to fork and send me pull requests with any improvements! I am also always happy to talk to data-informed members of the Product Management community who might be interested in using R.


Further reading

Comments

Popular posts from this blog

CONFERENCE: TTI Summer Forum 2017 – Getting to Grips with GDPR

On HBX and online education

On performance and environment