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

Part 4: Custom Functions extra text #53

Open
CheFusi opened this issue Jun 24, 2024 · 1 comment
Open

Part 4: Custom Functions extra text #53

CheFusi opened this issue Jun 24, 2024 · 1 comment

Comments

@CheFusi
Copy link

CheFusi commented Jun 24, 2024

" # every time we would have written the continent, we now write 'cont'"

should be removed - not used

@CheFusi
Copy link
Author

CheFusi commented Jun 24, 2024

Happens in the portion of script right before the Key Points (shown below). In this chunk of script, " # here we use the paste0() function to allow cont to change in the title" is text that also should be removed

"
lifeexp_plot <- function(country_name){

function plotting life expectancy against over time by country

country_name = name of country, string

every time we would have written the continent, we now write cont

p <- gap %>%
filter(country == country_name) %>%
ggplot(aes(x = year, y = lifeExp)) +
geom_point() +
# here we use the paste0() function to allow cont to change in the title
ggtitle(paste0("Life expectancy over time in ", country_name)) +
ylab("Life expectancy (years)") +
xlab("Year") +
theme_bw()

return the plot so it prints out when we call the function

return(p)

}"

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

1 participant