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

Use readr::read_csv() throughout the lesson #663

Merged
merged 6 commits into from
Oct 20, 2020

Conversation

Teebusch
Copy link
Contributor

@Teebusch Teebusch commented Oct 15, 2020

Currently, "starting with data" introduces base R's read.csv(), but "Manipulating data" then switches to readr::read_csv().
SInce R 4.0 the default behavior of both functions is to read strings as character vectors, so there is little reason to introduce both. For beginners the confusion that this creates is arguably larger than the insights gained from it, as evidenced by some of the issues here.

This is related to a number of issues and might close some of them:
#609 #471 #608 #553 #555 #559 #616 #645

The main change is:

  • move to "starting with data" section: explanation of packages and package loading, introduction of tibbles,
  • remove discussion of "stringsAsFactors" (except for a short mention of former default behavior)
  • adapt challenges and code examples
  • smaller rewriting here and there.

Copy link
Member

@fmichonneau fmichonneau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for taking the time to work on this @Teebusch!
My only suggestion would be to remove (or make an aside) the comparison between the base data.frame object and the tibble given that most of the workshop participants will not know what a data.frame is and the comparison will add cognitive load.
Everything else is a great improvement to the current content. So thanks again!

02-starting-with-data.Rmd Outdated Show resolved Hide resolved
with the function `str()`:

```{r, purl=FALSE}
str(surveys)
```

You might have noticed that our data frame is actually a "tibble". A tibble is a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might introduce confusion to learners as they probably won't know the difference between an object of class data.frame and a tibble if this is their first exposure to R.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree! See my suggested changes in 4991253

02-starting-with-data.Rmd Outdated Show resolved Hide resolved
02-starting-with-data.Rmd Outdated Show resolved Hide resolved
@fmichonneau
Copy link
Member

would another @datacarpentry/r-ecology-lesson-maintainers be willing to also review this PR? Thanks!

Teebusch and others added 4 commits October 16, 2020 19:48
Co-authored-by: François Michonneau <francois.michonneau@gmail.com>
Co-authored-by: François Michonneau <francois.michonneau@gmail.com>
change heading to "Inspecting data frames" and make headline capitalization consistent
The distinction between tibbles and data frames became less important with the change to "stringsAsFactors = FALSE", so it should be safe to treat them as more or less the same for this lesson.  Hopefully this reduces cognitive load.
@mondorescue
Copy link
Contributor

would another @datacarpentry/r-ecology-lesson-maintainers be willing to also review this PR? Thanks!

@fmichonneau I'll review this PR as a second.

Copy link
Contributor

@mondorescue mondorescue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the changes looks good to me.

@fmichonneau fmichonneau merged commit 36f14b0 into datacarpentry:main Oct 20, 2020
@fmichonneau
Copy link
Member

Thank you both!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants