I'm pretty new to R, and I have a project where I have a df in which there are a lot of NA values. My aim is to remove the NA-s from the cells. My problem is that I only found sollutions to remove the whole row or column.
My dataframe looks like:
V1 V2 V3
1 1 2 NA
2 NA 1.1 NA
3 2.1 1 NA
4 3.4 NA 5
And so on...
My goal is to get something like this:
V1 V2 V3
1 1 2
2 1.1
3 2.1 1
4 3.4 5
So basically I want all my values to start from the same position. Its not a problem if the NA-s go the end, I just need it to everything will be below each other.
So far I tryed na.omit(), na.rm and complete.case
, but non of them seemd to help me.
Any help would be appreciated!