Thank you so much for your help lol. I am unfortunatley still getting an error with the aesthetics:
Error in geom_line():
! Problem while computing aesthetics. Error occurred in the 1st layer.
Caused by error in check_aesthetics():
! Aesthetics must be either length 1 or the same as the data (1338) Fix the following mappings: y
Run rlang::last_trace() to see where the error occurred.
rlang::last_trace()
<error/rlang_error>
Error in geom_line():
! Problem while computing aesthetics. Error occurred in the 1st layer.
Caused by error in check_aesthetics():
! Aesthetics must be either length 1 or the same as the data (1338) Fix the following mappings: y
We have your programme but I think we need to see some sample data.
A handy way to supply some sample data is the dput() function. In the case of a large dataset something like dput(head(mydata, 100)) should supply the data we need. Just do dput(mydata) where mydata is your data. Copy the output and paste it here. between
```
```
The mean_charges_by_age data frame should have two columns, one with the age groups and one with mean_charges for each age group. You should use data = mean_charges_by_age instead of data = insurance. You should also use mean_charges as the Y variable.