-
Notifications
You must be signed in to change notification settings - Fork 266
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
Why is this not plotting? I keep getting the same error. #20
Comments
Looks like you have a |
Thanks. I tried that but it didn't work. I'm knew to R so I must have missed a step along the way. |
This code runs fine. What's different from yours? When you say you tried what I suggest, what did you try? When you're having unexpected results in R, another good approach is to restart your R session and try running again (under the pacman::p_load('dplyr', 'tidyr', 'gapminder',
'ggplot2', 'ggalt',
'forcats', 'R.utils', 'png',
'grid', 'ggpubr', 'scales',
'bbplot')
line_df <- gapminder %>%
filter(country == "Malawi")
#Make plot
line <- ggplot(line_df, aes(x = year, y = lifeExp)) +
geom_line(colour = "#1380A1", size = 1) +
geom_hline(yintercept = 0, size = 1, colour="#333333") +
bbc_style() +
labs(title="Living longer",
subtitle = "Life expectancy in Malawi 1952-2007")
line Created on 2020-05-18 by the reprex package (v0.3.0) |
I got it to work when I put: plot (line <- One more question. How do I get R to pull an image-logo from my files in the final line of code. I've tried using a web link to our website, but also .png from my harddrive. Do I need to load the image first? Possibly the image I'm using is just too big, but I didn't think that makes sense considering it's a .png vector finalise_plot(plot_name = my_line_plot, |
Here's the actual code that I can't get to plot: plot (finalise_plot(plot_name = "line", |
Ok, let's take a step back here because you have a few things going on at once. First, wrapping Moving on to your second question, Second, you have Since this is getting a little more detailed, I'm also going to skip ahead to something I was going to bring up after we resolved your issue, which is that GitHub issues are not generally a good place to ask questions like this. You might like asking for help at a place like RStudio Community. Additionally, you can maximize your chances of getting help by sharing your code in a reproducible example. Here is a good guide on preparing R questions, as well as a list of places that are good for asking for help: https://www.tidyverse.org/help/ If these don't fix your issue, my recommendation would be to post at RStudio Community. You can feel free to tag me (my username is So if this doesn't solve your problem, please close this issue and ask for help there (maybe with a link to this issue). |
Dude, you're the man. Thanks so much! |
See the attached screenshot.
<img width="1415" alt="Screen Shot 2020-05-17 at 1 30 23 PM" src="https://user-images.githubusercontent.com/65510741/82159476-28070180-9843-11ea-8433-d70ccf3045c5.png"
The text was updated successfully, but these errors were encountered: