奇怪的findFn故障

时间:2010-03-14 17:53:25

标签: r

我注意到使用findFn函数(库sos)时出现了一个奇怪的故障,我找不到源代码。虽然它在我的Windows XP电脑上运行良好,但它不适用于我的Vista。

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 个答案:

答案 0 :(得分:5)

sos 包的源代码中,findFn.R,第80行,我发现了错误

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

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

这样:

> findFn("{randomization+test}")
found 19 matches
相关问题