奇怪的findFn故障

Geo*_*tas 1 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.
Run Code Online (Sandbox Code Playgroud)

R ver = 2.10.1并更新了包.任何可能出现问题的想法?

奖励:很明显,我正在寻找有关的功能 tests for randomized experiments

Fed*_*rgi 5

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

  if (substr(string, 1, 1) != "{")
    string <- gsub(" ", "+", string)
Run Code Online (Sandbox Code Playgroud)

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

所以:

> findFn("{randomization+test}")
found 19 matches
Run Code Online (Sandbox Code Playgroud)

  • 但为什么它适用于Xp而不是Vista? (2认同)