Skip to content

Begin by promoting .Rmd files as preferred reproducibility #45

@libjohn

Description

@libjohn

throwing this out there for thought....

In line 237 of _episodes/01-intro-to-r.Rmd rm(list = ls()) is used. Because of what I'm reading and trying to practice about reproducibility, I want to suggest a change; specifically to promote .RMD scripts as the basic way to use R, this is instead of using .R scripts and ultimately instead of using rm(list = ls()). Since this is potentially a big change, I want to start the conversation....

I'm suggesting adding the following at line 239:
Note: rm(lists = ls())was a conventional and standard way to clear objects from the environment. Many coders habitually put that code at the top of their scripts. However, over time the R community began promoting more reproducible approaches to coding. The best way to clear your environment is write your scripts assuming a fresh R process and use the _Restart R and Run All Chunks_ feature of R Markdown documents. Learn more: [Restart R often during development](https://rstats.wtf/save-source.html#restart-r-often-during-development) and [What's wrong withrm(list = ls())](https://rstats.wtf/save-source.html#rm-list-ls)

This may suggest a different overall starting point where we do not even introduce the .R script, i.e. using .Rmd scripts instead of .R.

What do you think? We may want to shift the conversation to slack or our next meeting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions