Replace 0s with NA in tables

前端 未结 1 1811
梦如初夏
梦如初夏 2021-01-18 05:27

I generally work with dataframes and could easily do this for a data frame but on my current project I have the need to replace all zeros with NAs in a table structure. For

1条回答
  •  醉梦人生
    2021-01-18 05:56

    This should work:

    x[x==0] <- NA
    

    0 讨论(0)
提交回复
热议问题