nrow(roh)[1] 402
summary(roh$gewicht) Min. 1st Qu. Median Mean 3rd Qu. Max.
-1.00 72.72 80.80 80.41 88.80 117.70
sum(roh$gewicht < 0)[1] 3
head(roh[roh$gewicht < 0, ], 3) gewicht alter standort blutdruck
12 -1 73 Chur 140
88 -1 45 Chur 144
301 -1 18 Bern 123
sauber <- roh
sauber$gewicht[sauber$gewicht < 0] <- NA
round(c(vorher = mean(roh$gewicht), nachher = mean(sauber$gewicht, na.rm = TRUE)), 2) vorher nachher
80.41 81.02