Error : the argument is neither numerical nor logical: return of NA

Error : the argument is neither numerical nor logical: return of NA

1

I have a data in CSV format that contains 45 columns ( variables ) and 320 lines

The first column is the samples names and second column is group where sample belong

i imported the data in R using the followning command : data <- read.csv(“C:/Users/ut/Desktop/Doctorat_Perpignan/R/MYDATA.csv”, row.names = 1, sep=”;”)

when i wanted to calculate the mean using the following command : mean(data)

i obtained this error : Warning message: In mean.default(data_1) : the argument is neither numerical nor logical: return of NA

how can i solve this error please ?

also i wanted to calculate the the mean of all columns except the first and second columns using the following command : colMeans(data_1[ , 2:45]) , but i obtained the mean of each column and not the mean of all columns

Can you help me please to czlculate the mean of this data, Thank you


R


Statistics


Mean

• 31 views

Read more here: Source link

Tagged