how to determine if a character vector is a valid numeric or integer vector

前端 未结 6 1919
醉酒成梦
醉酒成梦 2021-01-04 01:38

I am trying to turn a nested list structure into a dataframe. The list looks similar to the following (it is serialized data from parsed JSON read in using the httr package)

6条回答
  •  臣服心动
    2021-01-04 02:14

    I don't see any advantage of plyr::ldply over regular base R methods:

     do.call(rbind, lapply(myList, data.frame) )
    #-------------
    
            w x.y x.z
    object1 1 0.1 cat
    object2 2 0.2 dog
    

    The trouble was arising because of a misguided attempt to "flatten" the data without consideration for it's intrinsic structure.

提交回复
热议问题