jasp-stats / jasp-issues

This repository is solely meant for reporting of bugs, feature requests and other issues in JASP.
58 stars 29 forks source link

[Feature Request]: Print R code in output #2008

Closed mathijsdeen closed 1 year ago

mathijsdeen commented 1 year ago

Description

Print the R code as used in Syntax Mode in the output screen

Purpose

code review; transparancy without the need for data sharing (i.e., sharing the JASP-file)

Use-case

Medical settings, where data sharing isn't always viable

Is your feature request related to a problem?

no

Is your feature request related to a JASP module?

Unrelated

Describe the solution you would like

Print the R code as used in Syntax Mode in the output screen

Describe alternatives that you have considered

copypasting the "syntax" in a note above the analysis

Additional context

First of all, the Syntax Mode that was added in version 0.17 is fantastic. I think it was one of the most longed-for functionalities among the users and has been called the top priority by JASP developers for a while. It's nice that you can not only see the R code, but edit it as well.

I was wondering if it's possible to show the used R code in the output as well. Usually, you would say that sharing the .jasp file is sufficient for transparancy and reproducibility, however sometimes you can't share your data (e.g., when you have medical data and/or case anonimity cannot be achieved because of the nature/contents of the dataset). If you then still want to maintain transparancy, not only sharing your output, but also sharing the underlying code might be a good thing. Also, this might be demanded by a journal editor or a teacher who is grading your statistics assignment - they often want to see whether your reasoning was ok without the need to repeat the analyses themselves.

Of course, what you can do, is add a note above the analysis output, and paste the used syntax there. But with many analyses, and checking and unchecking boxes repeatedly in the test pane which obviously changes the code at every change, this might become quite a hassle. So I was wondering if this could be done automatically, perhaps even in a nice command-line-like font (comparable to the syntax in SPSS output, and RMarkdown/Quarto code chunks).

EJWagenmakers commented 1 year ago

I think this is a great suggestion! Bruno, we should totally make this possible!