Geom_segment: Deleted 1 row containing missing values

I am working on a linear regression example for unified data.

An example is given on this webpage: http://al3xandr3.github.com/2011/02/24/ml-ex2-linear-regression.html

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

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

The error I am getting:

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

      

The line causing the error:

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

      

Can anyone help me with solving this error.

Sorry if this is an easy solution and if I am wasting your precious time.

Edit:

Forgot to note that the linear regression line I am trying to plot using geomass is not plotting.

+3


source to share


2 answers


Without looking at the example data, this is a typical warning from ggplot

just telling you that there was some missing data for some combination of the dataframe you were trying to plot. This is nothing to worry about as long as you don't expect any missing data. To know this, you need to look at the original dataset.



+5


source


It's not a mistake. This is a warning.

it deletes data, most likely because you have NA

s.


EDIT



Using the data you just gave and the code on this site I get:

enter image description here

Double check that there is no NA in your data and theta.

+5


source







All Articles