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

Re-use the pseudocode ordering exercise somewhere else #75

Open
kaijagahm opened this issue Nov 23, 2024 · 0 comments
Open

Re-use the pseudocode ordering exercise somewhere else #75

kaijagahm opened this issue Nov 23, 2024 · 0 comments

Comments

@kaijagahm
Copy link
Collaborator

This exercise was deleted when we removed episode 2 in #74. Let's keep this in mind and think about reusing it.

Order the conceptual steps of code

Here is a block of code that creates an example data visualization.

library(dplyr)
library(ggplot2)
fuel_efficient <- mtcars %>%
    filter(mpg > 30) %>%
    select(hp, mpg)
p <- ggplot(fuel_efficient, aes(x = hp, y = mpg))+
    geom_point()
p

Reorder the following conceptual steps so that they accurately reflect what this code is trying to accomplish.

A. Set up a visualization that will show the relationship between horsepower and fuel efficiency
B. Choose only the most fuel efficient cars
C. Display the plot that was just created
D. Load necessary packages
E. Simplify the dataset to show fewer columns
F. Add points to the initial plot

:::::::::::::: solution

Solution

D. Load necessary packages
B. Choose only the most fuel efficient cars
E. Simplify the dataset to show fewer columns
A. Set up a visualization that will show the relationship between horsepower and fuel efficiency
F. Add points to the initial plot
C. Display the plot that was just created
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

2 participants