R: eval(parse(…)) is often suboptimal

后端 未结 1 988
醉梦人生
醉梦人生 2020-12-01 21:26
require(\'fortunes\')
fortune(\'106\')
Personally I have never regretted trying not to underestimate my own future stupidity.
   -- Greg Snow (explaining why eval(pa         


        
相关标签:
1条回答
  • 2020-12-01 22:12

    Actually the list probably looks a bit different. The '$' convention is somewhat misleading. Try this:

    dat[["orders"]][[ or_ID ]][["price"]]
    

    The '$' does not evaluate its arguments, but "[[" does, so or_ID will get turned into "5810584".

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