Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discuss strategy to present R code in binder #29

Closed
cchwala opened this issue Oct 18, 2022 · 7 comments
Closed

Discuss strategy to present R code in binder #29

cchwala opened this issue Oct 18, 2022 · 7 comments

Comments

@cchwala
Copy link
Member

cchwala commented Oct 18, 2022

Python code examples in the sandbox use the jupyter notebook because that is a natural choice for Python users. For R users this is different. At best we would fine one consistent way of how to present the code examples in R. Ideally, IMO, something like a notebook, where one can quickly have a look at the plots, the code and some explanations as text, would be ideal.

@fenclmar
Copy link
Contributor

for R users probably the most natural choice would be R notebooks https://rmarkdown.rstudio.com/lesson-10.html One can easily preview them in R studio or look at html version which is automatically generated. Also PWS code of Lotte is now in this form. RStudio at Sandbox, however, now requires some updated version of markdown package to run notebooks.

@cchwala
Copy link
Member Author

cchwala commented Jun 16, 2023

Okay. I remember vaguely these discussion that we had offline.

One info regarding Lotte's code: The current example that is linked from the index notebook is a version that runs her R code in a Jupyter notebook. If I recall correctly @LottedeVos did that with support from @maxmargraf. I have no idea how much effort that was and how "fun" it is for R users to explore or work with the examples like this...

@cchwala
Copy link
Member Author

cchwala commented Jun 16, 2023

RStudio at Sandbox, however, now requires some updated version of markdown package to run notebooks.

Is this what is documented in #39 or related to it?

@overeem11
Copy link
Contributor

If https://rmarkdown.rstudio.com/lesson-10.html implies that we could just paste the contents of the Run.R script belonging to RAINLINK and adapt the formatting to markdown, that seems feasible.

@LottedeVos
Copy link
Contributor

Regarding the R code in Jupyter notebook: though I can imagine that i might be jarring to see multiple coding languages, I felt it went well to include the R code like this with a bunch of notes. Regardless of language preference, notes will be very important to take the reader along through the steps. The code is not fast or efficient in the final steps, that is the bigger problem in https://github.com/OpenSenseAction/OPENSENSE_sandbox/blob/5a9ac6e6239c9713bbf66cf25620a432d5dde0dd/PWSQC_R_notebook/PWSQC_minimal_example.ipynb

@fenclmar
Copy link
Contributor

I would now maybe vote for having R examples in jupyter in Sandbox as it is easy to convert jupyter notebbok to R markdown. THis code does the job:

library(rmarkdown)
convert_ipynb('jupyter_input_file.ipynb', 'Rmarkdown_output_file.Rmd')

It should be possible to do reverse conversion with some other package (see this) but I have not yet tried that.

@cchwala
Copy link
Member Author

cchwala commented Jul 4, 2023

The conclusion for now is to present the R code as Jupyter notebook in the sandbox. Hence, this issue can be closed.

@cchwala cchwala closed this as completed Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants