Is there an argument in summary (or another command) to force R to calculate values when there is “no data” in every cell?
In my questionnaire subjects did not provide all information; and for those cells I entered -nodata-. For cells where the answer is not applicable (based on the previous question in q.) I entered -1. The summary looks like this:
> summary(qs$ESC)
-1 -nodata- 0.5 1 12 15 3
49 3 1 1 1 1 1
What I want is calculated summary. Is there a way to tell R to disregard -nodata- and -1?
I don’t really understand what kind of summary you want to compute.
If you use NA instead of your “-nodata-” and “-1” codes, they would be automatically taken into account when using the
summaryfunction :For example :
You can see that here
vis considered as numeric, as there is no string value in it. When you introduce the “-nodata-” value it will be treated either as a character or as a factor variable.You can also use the
excludeargument of thetablefunction to automatically ignore some values :