I'm trying to study the distribution of weight (1 d.p numeric) vs age (integers). I tried using the following plot script:
babyData <- read.csv("baby2.csv", colClasses = c("NULL", NA, NA))
plot(babyData$Weight, babyData$Age,
main = "Distribution of Weight across ages",
sub = "Scatterplot of Baby Weight vs Age",
pch = 10,
cex = 0.5,
xlab = "Age",
ylab = "Weight")
And this is the resulting scatterplot:
This is how my data looks like:
As you can see, my Weight column has 1 decimal place but the plot function automatically rounds it and snaps to integers. How do I make the data points more precise down to 1 d.p? I tired googling and looking at documentations but I can't seem to fix it.
Thank you for your help and attention, sorry if this problem has been solved before.