tags:

views:

56

answers:

1

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 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 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

+4  A: 

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
Thrawn
It would be great if you submitted this to the package authors.
Shane
Done, I emailed the author, and gave him this page's link. Hopefully we add another R programmer to the community of StackOverflow :-)
Thrawn
But why it works on Xp and aren't on Vista?
Marek