Live data from Hacker News

Groundhog: Addressing the Threat That R Poses to Reproducible Research

datacolada.org

91–100 of 124 posts

Re: Groundhog: Addressing the Threat That R Poses to Reproducible Research

#91
I find the miniconda docker image quite useful for making reproducible R environments.

You can install specific package versions recorded in environment.yml file.

There are probably many ways to do this but this is an approach I like.

https://docs.anaconda.com/anaconda/user-guide/tasks/using-r-...

https://hub.docker.com/r/continuumio/miniconda

Re: Groundhog: Addressing the Threat That R Poses to Reproducible Research

#92
post #8

Reproducible? Or deterministic? There's certainly benefits to being able to pull down research source code, and bug checking it. That's how programmers check code: tests and audits. However I think reproducing research is more often then not done "from scratch", taking a new sample, treating it, checking results. "independent verification". Re-using source code saves time, but I would argue not being able to shouldn'…

This is why people are starting to make a difference between terms: repeatability, reproducibility, replicability.

> You give me your code and enough information for me to produce and identical environment or (even better) your code is insenstive the environment, then your research is Repeatable.

> If you describe your study sufficiently well that I can re-implement your study from scratch, without looking at your code and still get the same answer, then it is Reproducible

> If I can arrive at the same conclusions as you, just from a description of its aims, then it is Replicable.

From https://academia.stackexchange.com/a/118518/15198

Re: Groundhog: Addressing the Threat That R Poses to Reproducible Research

#93
post #8

Reproducible? Or deterministic? There's certainly benefits to being able to pull down research source code, and bug checking it. That's how programmers check code: tests and audits. However I think reproducing research is more often then not done "from scratch", taking a new sample, treating it, checking results. "independent verification". Re-using source code saves time, but I would argue not being able to shouldn'…

That's something that eludes software people: reproducibility in science is the ability to create independent tests. Making software available, while useful, does very little for reproducibility from the scientific point of view.

It's a minimum standard, though. Of course the goal is reproducibility from a broader point of view, but that's not an excuse to do research in a one-off way where nobody is able to show how to get those numbers again, after a year or so from publication.

The coding standards are often abysmally, unexpectedly terrible. Often not even the help of the original authors is enough to be able to produce the same figures from a paper because things and settings and commands get forgotten. Some part of the analysis was done in one language, another part in Excel. Some of the code has now disappeared. Some of the libraries are no longer working. Some people left and their academic storage space was wiped and therefore the intermediate steps and results or notes are deleted. You wouldn't believe it.

Once a paper is published researchers are not really incentivized to document things or maintain the materials. They got the publication, they put it on their CV. On to the next project! No time to waste on work that's already completed. New work leads to new publications, messing around with the old code for the sake of a potential later person interested in it is a waste from the point of view of a researcher, career wise. Also most papers are never attempted to be reproduced ever.

Re: Groundhog: Addressing the Threat That R Poses to Reproducible Research

#94
post #66
post #65

Earlier quoted context omitted.

If I am understanding this correctly, the problem is that the paper authors do not provide a specific version or a package.json equivalent. In that case, using dates seem to be the only choice.

Even if that's the case, using dates isn't a solution because dates don't give you the build that the researcher used. Date of publication is different from the date when the code ran and there is no guarantee that the researcher ran the latest version of every dependency that was available to them anyway. In fact that's very unlikely considering that some their libraries might require older versions. It might not ev…

So, what is your better alternative then? I honestly believe using version available at that date is better than using the latest version.

Re: Groundhog: Addressing the Threat That R Poses to Reproducible Research

#95
post #12
post #10

Earlier quoted context omitted.

Even this isn’t enough to be reproducible for complex numeric code as switching CPU can make a big difference with small differences being amplified. Hopefully none of those cases matter but it’s hard to definitively prove that.

If the research results depend on small differences being amplified you have a much much bigger problem. (but if course this could happen unnoticed/sloppy work)

That's true but not an excuse! It's still extremely important when assessing an anomaly. If you can say "okay this is a known-good config that gets me the numbers from the paper", it's an enormous help in uncovering what leads to issues.

If you can't even get those numbers, then you can suspect any number of things. Maybe you're not using the right data, maybe there was a typo, maybe someone fraudulently manually tweaked the numbers, maybe you forgot to do a step in the processing chain etc etc. There's no way to know what's going on if you can't even be sure how the original numbers were created.

Re: Groundhog: Addressing the Threat That R Poses to Reproducible Research

#96
This language about "threat" seems a bit overblown. Especially when we ask: compared to what? Some commercial package where different versions might have different and poorly documented data storage formats? (Have you ever tried to read an old SPSS or SAS or STATA data file in any reasonable environment? It is a nightmare.) Excel??

Re: Groundhog: Addressing the Threat That R Poses to Reproducible Research

#98
post #33

Either I'm misunderstanding or this is a non-problem. You can specify older versions of a package when you install it. You can also manage them with packrat. As long as researchers share their language and package versions, you can fully reproduce their environment. (And the base language is really stable, almost to a fault.) This is just a bad way for the author to promote their own library for dealing with this. Th…

Yeah, this seems half-thought-through. renv works at project level and isolates the dependencies of a project from your main library. groundhog.library() tramples over your library installing multiple versions. It also has the "cute" feature of auto-installing libraries if they aren't on your system already. Yuck. If you really wanted this script-only solution then you could go with the `versions` library, which already lets you specify an installation date.[1]

[1]: https://cran.r-project.org/web/packages/versions/index.html

Re: Groundhog: Addressing the Threat That R Poses to Reproducible Research

#99
post #94
post #66

Earlier quoted context omitted.

Even if that's the case, using dates isn't a solution because dates don't give you the build that the researcher used. Date of publication is different from the date when the code ran and there is no guarantee that the researcher ran the latest version of every dependency that was available to them anyway. In fact that's very unlikely considering that some their libraries might require older versions. It might not ev…

So, what is your better alternative then? I honestly believe using version available at that date is better than using the latest version.

[deleted]

Re: Groundhog: Addressing the Threat That R Poses to Reproducible Research

#100
post #44

Earlier quoted context omitted.

As I can see from the researchers in our cluster and my own academic research, most people still avoid spaces in paths and files like the plague. YMMV of course.

If my own hobby python projects are anything to go by, there aren’t even folders ;-) I have a friend who taught herself R for her research and it was basically one big procedural codebase.

Best way to know where every bit of code is: put it all in one source file.

Sarcasm aside, I've worked with codebases like that- thousand-line java methods and classes and the like. The problem is that there's nothing that really forces modularity on a codebase. There isn't even any consensus, objective way to modularise code. Otherwise, a machine could do it and we wouldn't have this kind of problem. But, a machine cannot, and so we do.

Post reply on HN