How to coerce a list object to type 'double'

前端 未结 5 623
执笔经年
执笔经年 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 06:55

    You can also use list subsetting to select the element you want to convert. It would be useful if your list had more than 1 element.

    as.numeric(a[[1]])

提交回复
热议问题