Errors with Shapiro test

I have been trying to perform the Shapiro test on my data with no success recently, I read some topics online which hasn't appeared to help me. The first command I wrote is:

shapiro.test(as.numeric(recup$Temps == "med"))

Which gave me the error:

all 'x' values are identical

Afterwards, I wrote this second command

shapiro.test(recup[recup$Temps == "med"])

Which gave me the error:

is.numeric(x) is not TRUE

Does anyone have any suggestion or can offer their own experience on how to write the correct command, essentially helping me to fix the errors in console that I am encountering.

Could you add information about what you are looking to learn about this character variable?

(recup$Temps == "med") will return TRUE or FALSE.

You are asking if the values of the Temps variable are equal to "med". Converting TRUE and FALSE to numeric will return 1 and 0.

The first error message means that all the values are "med", so all ones, or none of the values are "med", so all zeros.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.