[rkward-users] [Help] RE: How do I create matrix error bars?

SourceForge.net noreply at sourceforge.net
Tue May 11 22:41:09 UTC 2010


The following forum message was posted by kapatp at http://sourceforge.net/projects/rkward/forums/forum/165574/topic/3704541:

Ok, here is a working example. Replace x by your dataset name.

[code]x <- data.frame (id=1:10, X1=runif(10), X2=2*runif(10), X3=5*runif(10), X4=10*runif(10), X5=20*runif(10), X6=50*runif(10))
U <- reshape(x, varying=2:7, v.names=\'moles\', direction=\'long\')
U$time <- factor(U$time); levels(U$time) <- c(1,2,5,10,20,50);
library(lattice)

# aggregate() in R >= 2.11.0 has a method for formula objects
if (getRversion() <= \"2.10.1\") {
	S <- data.frame (moles=apply(x[,2:7],2,median), time=1:6)
} else S <- aggregate (moles~time, data=U, median)

trellis.par.set(box.rectangle = list(lty = 0))
bwplot(moles~time, data=U, horizontal=FALSE, xlab=\'time\',
	stats = function (...) {
		bstats <- boxplot.stats (...)
		bstats$stats[c(2,4)] <- bstats$stats[3]
		return(bstats)
	},
	panel = function (x,y,...) {
		panel.bwplot (x,y,...)
		panel.xyplot(x=S$time, y=S$moles,type=\'l\')
	}
)[/code]

If this much of coding puts you off then [b]R[/b] is not the right software for you!

Now, here is a bit of illuminating rant:
As Thomas pointed out earlier,  Rkward is merely a GUI; [b]R[/b] is the main statistical engine behind [b]Rkward[/b]. The minimally available menu driven (statistical) functions in Rkward is ofcourse driven by appropriate R functions/code underneath. [b]Again, Rkward is not a statistical software.[/b] So, if you are used to menu driven softwares, such as, SPSS, SigmaPlot (as you mentioned), Minitab, StatXact, STATISTICA (even SAS and Splus to a good extent), then I am sorry to spoil your surprise, [b]with R[/b] you are in for a rude shock (of course, depends on how much of data handling you do): 
* R is completely comandline driven. 
* You could use R from a just a terminal (xterm, aterm, uterm, konsole, gnome-terminal, ...). 
* If you have used the emacs editor then you could run R (or Splus) from withing emacs (using ESS)
* You could use kate (the KDE editor) and link with an R session w/o using RKward (it is a pain though)
* There is a similar plugin for gedit as well..
* http://en.wikipedia.org/wiki/R_%28programming_language%29

To repeat: RKward will not hold your hand through your statistical analysis! As you can see from the code above, it has nothing to do with RKward!!

Good luck.




More information about the Rkward-users mailing list