Hi,
Plentiful packages are the most charming resources in
R environment. But I met some questions in application.When loading some
packages , its function couldn't return result,but
IStatConnectorCharacterDevice can receive information. This has resulted in
constructing a complex function on the basis of loaded package is
difficult. Code as follow:
R myR=new R();
myR.loadLibrary("fCalendar");
string tet= myR.evaluateAsText("x=search()");
string tet2 = myR.evaluateAsText("x<- Sys.timeDate()");
# test2 received as : 2008-09-20 23:11:10 ;
object tet3 = myR.GetSymbol("x"); # occur Error!
----------------------------------------------------
public string evaluateAsText(string cmd)
{
string
cmdprint = cmd.StartsWith("print") ? cmd : "print(" + cmd + ")";
Output.Clear(); # public RCharDev Output { get { return
_characterDevice; } }
try
{
EvaluateNoReturn(cmdprint);
}
catch { }
string txt =
Output.Text;
if
(txt.ToLower().IndexOf("error") >= 0)
{
throw new Exception("evaluateAsTextException:" + txt);
}
Output.Clear();
return txt;
}
----------------------- ( Thanks everyone observed advance
^-^)
Bryan
-------------------------------------------------------------------
新浪空间——与朋友开心分享网络新生活!(http://space.sina.com.cn/)
_______________________________________________
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at