Задача: суммировать все элементы в столбце.
Проблема: при этом появляется следующая ошибка: «NA введены путем принуждения».
Как мне избежать этого?Это то, что я сделал до сих пор:
load dataset and get the table:
dat <- read.table("http://stat.ethz.ch/Teaching/Datasets/milben.dat")
get the first column and exclude first element:
fc<- dat[-1,1]
transform factors in numbers and compute the sum
sum(as.numeric(levels(fc))[fc]) numbers
Большое спасибо!