Getting “NA” when I run a standard deviation

后端 未结 4 1476
鱼传尺愫
鱼传尺愫 2021-01-02 02:33

Quick question. I read my csv file into the variable data. It has a column label var, which has numerical values.

When I run the command

4条回答
  •  别那么骄傲
    2021-01-02 03:25

    Try sd(data$var, na.rm=TRUE) and then any NAs in the column var will be ignored. Will also pay to check out your data to make sure the NA's should be NA's and there haven't been read in errors, commands like head(data), tail(data), and str(data) should help with that.

提交回复
热议问题