Replace.NA: Replace NA by mean

View source: R/ScriptFonctionsSourcesVpack.r

Replace.NAR Documentation

Replace NA by mean

Description

replace NA value by the mean of the column

Usage

Replace.NA(TAB)

Arguments

TAB

a table with numeric values with possible NAs

Value

the same table as TAB but without anymore NA values

Examples

#Le tableau pour tester :
var1<-c(8,4,5,6,NA)
var2<-c(1,NA,2,1,3)
var3<-c(NA,11,10,NA,12)
tab_essai<-data.frame(var1,var2,var3)

#L'utilisation de la fonction :
tab_essai_new<-Replace.NA(tab_essai)

RenaudJau/Renaudpack2 documentation built on Feb. 16, 2025, 7:33 p.m.