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

Suggestion - Print Statement after Data Frame Manipulation functions #882

Open
sndaba opened this issue Jul 6, 2022 · 1 comment
Open

Comments

@sndaba
Copy link

sndaba commented Jul 6, 2022

Hi

I noticed that the functions used in the Data Frame Manipulation with Dplyr episode https://swcarpentry.github.io/r-novice-gapminder/13-dplyr/index.html do not have a print ( ) statement for the output of the dplyr functions.

I suggest adding the print statement for every Dplyr function for learners to follow the different outputs every function creates.
For example, the following function from the episode can have the following printing statement after the select( ) statement;
year_country_gdp <- select(gapminder, year, country, gdpPercap)
print(year_country_gdp)

or

year_country_gdp <- select(gapminder, year, country, gdpPercap)
year_country_gdp

@sndaba sndaba changed the title Suggestion - Print Statement after Data Frame Manipulation functions #545 Suggestion - Print Statement after Data Frame Manipulation functions Jul 6, 2022
@zkamvar zkamvar transferred this issue from swcarpentry/r-novice-inflammation Dec 15, 2023
@naupaka
Copy link
Member

naupaka commented Jan 19, 2024

Thanks for the suggestion! My sense is that generally print() statements are used on infrequently in R code, since the output can be checked by simply selecting and running the code of interest. I worry that it might be more confusing to break up the dplyr pipe chains any further. In a number of places in the lesson, the output is visualized using either a direct output of the data frame or the use of head() etc.

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

No branches or pull requests

2 participants