Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

geom_segment: Removed 1 rows containing missing values [closed]

I am working through a linear regression example for uni variate data.

The example is listed in this webpage: http://al3xandr3.github.com/2011/02/24/ml-ex2-linear-regression.html

Sorry for not pasting any code that I tried because I am not very familiar with R. I am a beginner.

I read the R documentation to solve this error but I was unable to figure out the cause of this error.

The error that I am getting is:

Warning message:
Removed 1 rows containing missing values (geom_segment). 

The line which is causing the error is:

ex2plot + geom_abline(intercept=theta[1], slope=theta[2])

Can any one help me in solving this error.

Sorry again, If this is a simple solution and if I am wasting your valuable time.

Edit:

Forgot to mention, the linear regression line that I am trying to plot using the geom_abline is not plotting.

like image 275
user1787687 Avatar asked Dec 05 '25 17:12

user1787687


1 Answers

Without looking at your example data, this is a typical warning from ggplot that is simply telling you that for some combination of the data frame you tried to plot, there was some missing data. It's nothing to worry about unless you weren't expecting any missing data. To know that, you'll need to look at your original data set.

like image 129
Bryan Hanson Avatar answered Dec 08 '25 08:12

Bryan Hanson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!