Skip to content
Prev 307068 / 398506 Next

Calculating the mean in one column with empty cells

fxen3k <f.sehardt <at> gmail.com> writes:
http://r.789695.n4.nabble.com/Calculating-the-mean-in-one-column-with-empty-cells-tp4645135.html
Hi Felix,

Assuming that you have the data frame formatted properly, mean(yourdata$column,
na.rm = T) should work.  When coverting an excel table to R, I usually fill in
blank cells with NA before importing.  If you try to import an data frame with
empty cells, you usually get an error using read.table().  But since you seem to
have already got you data into R, that may not be the problem.

HTH,
Ken