Monday, January 09, 2006
R is an integrated suite of software facilities for data manipulation, calculation and graphical display. It consists of a language plus a run-time environment with graphics, a debugger, access to certain system functions, and the ability to run programs stored in script files. R language is an interpreted computer language derived from S language. Scientist use R mostly as a statistical analysis tool. You can download a copy of R from R-project home page (under GNU license).
My last project involve R is a gene expression profile analysis from microarray experiment two years ago. If you were a computer geek, it will take you less than 30min to learn to use R environment because it is object-oriented and synax similar to C.
Monad can can interact with other program using COM-based technologies. For example:
1. From /\/\o\/\/ blog: Monad Really Does Rock
2. From Monad team blog: Check spelling script
In order to use R language interpreter in MSH, we need another R addon: R-DCOM, which works with
Rproxy.dll(in the R distribution) and
R.dllto support transfer of data to and from R and remote execution of R commands, as well as embedding of an R graphics window.
After insatll R and r-DCOM, we can enjoy the power of R under MSH prompt:
# Create a new com object for R
$RCom = new-object -com StatConnectorSrv.StatConnector
# Call Init method to load R environment
# Check out available methods
Name MemberType Definition
---- ---------- ----------
AddGraphicsDevice Method void AddGraphicsDevice (string, ISGFX)
Close Method void Close ()
Evaluate Method Variant Evaluate (string)
EvaluateNoReturn Method void EvaluateNoReturn (string)
GetConnectorInformation Method string GetConnectorInformation (Informa...
GetErrorId Method int GetErrorId ()
GetErrorText Method string GetErrorText ()
GetInterpreterInformation Method string GetInterpreterInformation (Infor...
GetServerInformation Method string GetServerInformation (Informatio...
GetSupportedTypes Method void GetSupportedTypes (int)
GetSymbol Method Variant GetSymbol (string)
Init Method void Init (string)
RemoveGraphicsDevice Method void RemoveGraphicsDevice (string)
SetCharacterOutputDevice Method void SetCharacterOutputDevice (IStatCon...
SetErrorDevice Method void SetErrorDevice (IStatConnectorChar...
SetSymbol Method void SetSymbol (string, Variant)
SetTracingDevice Method void SetTracingDevice (IStatConnectorCh...
SetUserInterfaceAgent Method void SetUserInterfaceAgent (IStatConnec...
# Send expression to R interpreter
# where c() is a function to assign a "vector" Variant to x
# remember R language is case senitive
$Rcom.EvaluateNoReturn ("x <- c(79.98, 80.04, 80.02, 80.04, 80.03, 80.03, 80.04, 79.97, 80.05, 80.03, 80.02, 80.00, 80.02)")
$Rcom.EvaluateNoReturn ("y <-c(80.02, 79.94, 79.98, 79.97, 79.97, 80.03, 79.95, 79.97)")
# use R graphic device to make boxplot
$Rcom.EvaluateNoReturn ("boxplot(x, y)")
# Student t test: two variant; two sided; unpaired
$Rcom.Evaluate("t.test(x, y, alternative = c(`"two.sided`"))")
0.00693932661444795 #P-value (if less than 0.05, means statitical significant)
0.0138552637266242 #lower 95 percent confidence interval
80.0207692307692 #average of x
0 #alternative hypothesis: true difference in means is not equal to 0
Welch Two Sample t-test
x and y
# Dispose R Environment
[Edit: Monad has now been renamed to Windows PowerShell. This script or discussion may require slight adjustments before it applies directly to newer builds.]
Oes Tsetnoc | Semangat Mengembalikan Jati Diri Bangsa
Fine its the good information!!!
I used this site http://www.xnynz.com/ for doing hosting services & got nice solution.
They are very much good in providing services !!
This site provide the hosting services at cheap cost than other hosting company..
Have a good start !!!
Links to this post:
- Name: Fang Shen
All posts are provided 'as is' with no warranties, and confers no rights. You assume all risk for your use.
Atom Feed: atom.xml
- Current Posts
Useful LinksMicrosoft PowerShell Portal
Powershell team blog
Precision Computing blog
Under The Stairs
Keith Hill's Blog
MSH Community Extensions
Jeff's Scripting Blog
::: MSH :::