standard deviation on dataframe does not work

后端 未结 1 1622
闹比i
闹比i 2020-12-20 12:11

I have an unexpected [for me at least] error in calculating a standard deviation. The idea [*] is to convert all missing values to 1 and 0 otherwise. Then extract variable

1条回答
  •  生来不讨喜
    2020-12-20 13:00

    sd on data.frames has been defunct since R-3.0.0:

    > ## Build a db of all R news entries.
    > db <- news()
    > ## sd
    > news(grepl("sd", Text), db=db)
    Changes in version 3.0.3:
    
    PACKAGE INSTALLATION
    
        o   The new field SysDataCompression in the DESCRIPTION file allows
            user control over the compression used for sysdata.rda objects in
            the lazy-load database.
    
    Changes in version 3.0.0:
    
    DEPRECATED AND DEFUNCT
    
        o   mean() for data frames and sd() for data frames and matrices are
            defunct.
    

    Use sapply(x, sd) instead.

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