开发者

Strange findFn malfunction

I noticed a strange malfunction in using findFn function (library sos) and I can't find out the source. While it works fine on my Windows XP pc, it does not on my Vista one.

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 t开发者_运维技巧han 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 and packages updated. Any ideas where the problem might be?

Bonus: As it's obvious, I was looking for functions about tests for randomized experiments


In the source code of the sos package, findFn.R, line 80, I found the mistake

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

This "if" is wrong, with an != instead of ==, and therefore the space doesn't get translated into a +. The quick solution would be to use the "+" syntax yourself

so:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜