5
Hi, I’m having trouble at ggplot2 on a histogram.
The code:
ggplot(data.combined[1:891,], aes(x = Age, fill=Survived)) +
facet_wrap(~Sex + Pclass) +
geom_histogram(binwidth = 10) +
xlab ("Age") +
ylab ("Total Count")
With the following code, using exactly the same data of a tutorial I’m getting a histogram in which the value of 0 (initial) is in the middle of the first box, already in the tutorial the subject box starts at zero.
Can someone help me with this? I am worried because along the difference between one being in the beginning and the other in the middle I get distortions in reading the information on my chart, harming the interpretation.
How should I get:
How do I get:
Thank you very much!
Hello! Actually, it has greatly improved my visualization already. However, would you like to tell me why I still have some distortions to my chart? For example, if you click here and observe his at 23:04: https://youtu.be/u6sahb7Hmog?t=23m4s compared to what I’m getting now, do you know why the distortions between me and him? Here’s my current:
– Guilherme Heiden
@Guilhermeheiden It is difficult to say just by looking at the two images, but I imagine they can be two causes: 1. You are using Windows, and it OSX, the graphics devices are different and may be changing something. 2 (most likely). The video is from 2014, and who knows when it was recorded, then the versions of R and the
ggplot2
are different and changes may have been made. If you are just taking the course, do not worry about these details, when it is in fact create a chart there yes it is worth going after the details.– Molx
Thank you so much @Molx! You’ve been so helpful and understanding, I’ll follow then, hug!
– Guilherme Heiden