yannrichet/rsession

Found a bug in isPackageInstalled

Closed this issue · 1 comments

I think I found a bug in isPackageInstalled.
silentlyVoidEval(packs + "<-installed.packages(noCache=TRUE)", false);
boolean isinstalled = false;
REXP r = silentlyEval("is.element(set=" + packs + ",el='" + pack + "')");

If some time series packages except "zoo" have been installed, is.element(set=packs, el='zoo') always returns TRUE as "zoo" is in Depends or Suggests etc.

is.element(set=row.names(packs), el='zoo') or is.element(set=packs[,1], el='zoo') could fix the problem.

thanks.