Reality Bending LabNews › How to share data analysis scripts with publications?

How to share data analysis scripts with publications?

2021-02-10 · Lab · Dominique Makowski

Including data analysis as Supplementary Materials can be a tedious task. How can we simplify the sharing of our work? So that it can be fully appreciated, as well as evaluated, improved, worked on, in a transparent and open way?

Option 1: Dump the code in a word file

Most publication portals don't directly accept code scripts to be included "as is". In other words, you cannot upload your manuscript and your .R script just like that. So one option is to copy its content, paste it in a word / pdf document, and Voilà!

But what if you don't have code because you use a point-and-click software? Well, you can note down all the x,y coordinates of your clicks so that one can reproduce the steps and all the clicks. Just kidding, if you don't have a script, then may god have mercy on your soul.

Why is that a terrible solution? Because let's face it, unstructured code dumps are horrific. Nobody wants to read it, it does not make justice to your work, and it's still tedious to create! You have to re-do it every time you modify your code. And it's even worse if you want to include all the outputs, figures, tables that are generated by the code? Data analysis is not just the code, but everything that comes with it and that allowed you to make the conclusions that you made.

Option 2: Use Rmarkdown

Rmarkdown is a "framework" that allows you to have files (.Rmd) that can contain a mix of text and code (and not only R, but also Python for instance!).

It can be used to write comprehensive "reports" that include all your thoughts, motivations and interpretations of the results. And the great thing about it is that these files can be converted into beautiful and readable documents like PDF, Word or HTML. It will automatically embed the code and its generated output (as text, tables or figures) alongside the text.

It is an awesome way to write statistical reports, and can even be used to create many other non-stats related stuff, like APA-formatted manuscripts (great for preprints), books, presentation slides, websites or blogs. It's a must-have skill for every researcher.

And it gets better!

Option 3: Use our Results Template

In the Reality Bending team, we like to have our different projects and studies organized in a consistent way. We heavily use GitHub to store our projects and collaborate on them, and we also like the possibility of making these projects open and accessible (i.e., easy to discover and explore) when the time comes.

That's why we came up with a Template folder for storing the materials related to a given study, including well-organized analysis scripts. And what's great about it is that it is set up in a way that allows you to generate multiple file formats (word, pdf, html) with a single click (and even without any click, in a fully automatic way)! And what's even greater is that if you decide to upload it to GitHub, you'll have a whole website presenting your data analysis!

We use it to have reproducible analysis that we can easily share with publications. We can upload the .pdf or .docx file generated by the template as Supplementary Materials, but we also link the URL of the online repository of the study in the manuscript, where users can access and experience the content in the format that they prefer. It really improves the appeal of a study when the results are trustworthy.

All this is easily made possible with our template. Check it out here:

👉 https://github.com/RealityBending/TemplateResults 👈

And let us know what you think! You can open an issue on the repo or even contribute to help us improve it :)


Thanks for reading! 🐦 Don't forget to join me on X (@Dom_Makowski)

Keep reading

Click to Open
Reality Bending Lab

Exploring the neuropsychology of reality and its distortions.

The Reality Bending Lab, led by Dominique Makowski at the University of Sussex in Brighton, UK, conducts world-leading research on reality perception, illusions, fake news, AI-beliefs, deception and its links with emotions, cognitive control and the Self. Using recording signals from the body (ECG, EDA…) and the brain (EEG), we analyse data using advanced modelling (Bayesian statistics, chaos theory, computational models) and develop open-source tools to improve neuropsychological science.

“Do not try to bend the spoon — that’s impossible. Instead, only try to realise the truth: there is no spoon. Then you'll see that it is not the spoon that bends, it is only yourself.”

People

Information

Where to find us

The Reality Bending Lab is based in the School of Psychology, at the University of Sussex in Brighton, UK.

Pevensey 1 - room 2B7, School of Psychology, University of Sussex, BN1 9QH

The University of Sussex campus in the South Downs University of Sussex crest

University of Sussex

Brighton is the sunniest city in the UK and, by some margin, its most cheerfully strange — on the sea, an hour from London. The University of Sussex sits just above it in the South Downs, and its School of Psychology is one of the largest and strongest in the country.

It is famous for its research on consciousness and interoception, with scientists like Anil Seth, Andy Clark, Zoltan Dienes and Hugo Critchley, its teaching of cutting-edge psychological methods (with stats rockstar Andy Field), its history of multidisciplinary research (arts and science), and its radical engagement in open and disruptive science.

Join this community

Hire us Join the Lab Like this website? See how to get yours