Hi everyone,

 

I've got a question concerning missing values in R.

 

I'm looking for an R code which removes all NA values in my data.frame. I
found many answers about how to remove rows or columns which contain NA's.
My problem however is a bit different. I have a list of vectors. Each vector
contains some NA Values that I want to remove. So, at the end all vectors
will have different dimensions. My final goal is to apply a function(x) to
all of the vectors. Any hints how to do this? Should I change the
class=data.frame of my list of vectors? Below I made a simple example how my
table looks like and how my result should look like.

 

 

My table:

                V1          V2

1             1.2          2.1

2             1.3          2.2

3             NA         4.5

4             NA         1.5

5             1.9          NA

 

My intended result:

                V1          V2

                1.2          2.1

                1.3          2.2

                1.9          4.5

                                1.5

 

 

Many thanks in advance & best regards

S.B.

 


	[[alternative HTML version deleted]]

