代码之家  ›  专栏  ›  技术社区  ›  Yorgos

奇怪的故障

r
  •  1
  • Yorgos  · 技术社区  · 16 年前

    findFn 函数(库 sos

    library (sos)
    
    findFn("randomization test")
    # in both finds 72 results
    
    findFn("{randomization test}")
    # In XP finds 19 or about so, but in Vista whenever I use {} and more than one word inside, 
    # I keep getting the following:
    
    found 0 matches
    x has zero rows;  nothing to display.
    Warning message:
    In findFn("{randomization test}") :
      HIT not found in HTML;  processing one page only.
    

    R ver=2.10.1,更新包。 你知道问题出在哪里吗?

    奖励:很明显,我在寻找关于 tests for randomized experiments

    1 回复  |  直到 16 年前
        1
  •  5
  •   Federico Giorgi    16 年前

    在源代码中 包裹,找到了,80行,我发现了错误

      if (substr(string, 1, 1) != "{")
        string <- gsub(" ", "+", string)
    

    这个“如果”是错误的,带有一个!=而不是==,因此空间不会转换为+。快速的解决方案是自己使用“+”语法

    > findFn("{randomization+test}")
    found 19 matches