public string[] GetInstalledPackages()
{
string commandstring = "tmp <- installed.packages()";
_journal.WriteLine(commandstring);
_dispatcher.EvaluateToObject(commandstring, false);
// tmp contains following fields(info about packages )
// <row-header is packagename>, Package, LibPath, Version, Priority, Depends, Imports,
// LinkingTo, Suggests, Enhances, OS_type, License, Built.
// commandstring=".packages(all.available = TRUE)" //command can also be used below. just one command is enough instead of 2.
object o = _dispatcher.EvaluateToObject("rownames(tmp)", true); // returns row-header which are packagenames.
string[] pkgs = this.ObjectToStringArray(o);
return pkgs;
}