I read Data from a csv file. If I see this file in R, I have:
V1 V2 V3 V4 V5 V6 V7
1 14 25 83 64 987 45 78
2 15 65 789 32 14 NA NA
3 14 67 89 14 NA NA NA
If I want the maximum value in each column, I use this:
apply(df,2,max)
and this is the result:
V1 V2 V3 V4 V5 V6 V7
15 67 789 64 NA NA NA
but it works on the column that has no NA
. How can I change my code, to compare columns with NA
too?