How to coerce a list object to type 'double'

前端 未结 5 630
执笔经年
执笔经年 2020-12-02 06:13

The code:

a <- structure(list(`X$Days` = c(\"10\", \"38\", \"66\", \"101\", \"129\", \"185\", \"283\", 
                                 \"374\")), .Names         


        
5条回答
  •  臣服心动
    2020-12-02 07:07

    If your list as multiple elements that need to be converted to numeric, you can achieve this with lapply(a, as.numeric).

提交回复
热议问题