[RkWard-devel] length() and na.rm

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Aug 17 11:15:10 UTC 2006


On Thursday 17 August 2006 13:49, Stefan Rödiger wrote:
> Moreover I wanted to add Skewness and Kurtosis which both are not in stat
> or base but in the  moments package. The way to go would be via require ...
> . So my problem is:
> 1) is it reasonable to include it as a part of descriptive statistic?

I don't know for sure. However I tend to think we should rather produce 
smaller plugins, each doing only a limited set of functions.
Of course some will prefer larger, combined interfaces. But wherever possible 
those should be created by embedding several small plugins in a large one. 
We'll have to see whether this is practical in all instances, but for now I'd 
say rather make those functions a separate plugin.

> 2) if yes, should I use the package or use a formula from a textbook? {if I
> use the package, how can it be handled that the user doesn't need to bother
> where he can get it and will it effect the performance of RKWard in long
> term ("load <-> unload, memory usage, ..., stability)}

I'm not too much concerned about memory usage, performance, etc. However, 
having to install a package is not nice, but as long as it is limited to the 
cases, where the functionality is actually needed, I think it's ok (something 
like):

if (options$skew || options$kurtosis) require (moments)

It's unfortunate those functions are not part of the "standard" R packages. 
However, I think recoding them from textbook formulas is generally not the 
way to go. After all, loading extensions from libraries is one of the key 
concepts of R.

> 3) moreover I would like to include "mode" (see
> http://en.wikipedia.org/wiki/Mode_(statistics)) but there is no such
> function from R.

Seems strange there is no such function in R. Here's a formula:

names(table(x))[which(table(x)==max(table(x)))]

BTW, I found the formula on this page (German):
http://www.wiwi.uni-bielefeld.de/~wolf/learning-net/webserver/rechendienst.operationen.php?operation=Modus&daten=

Could possibly be optimized to

rk.temp.freqtable <- table (x)
names (rk.temp.freqtable)
[which(table(rk.temp.freqtable)==max(table(rk.temp.freqtable)))]

which looks even more convoluted, but avoids calculating "table (x)" over and 
over again.

> 4) last but not least I would like to include the posibility to include
> several plots but in as thumbnail view. We could reuse the code from the
> histogram with  par(mfrow = c(n,m) and a boxplot too. I think this gives a
> good overview of data. (To bad that we don't have (yet ;) ) the svg
> support, this would be great if people want to use these images so thta
> they can resize them and so on).

If you look at rk.graph.on (), it's really just

function () 
{
    filename <- rk.get.tempfile.name(prefix = "graph", extension = ".png")
    png(file.path(filename))
    cat(paste("<img src=\"", filename, "\"><br>", sep = ""), 
        file = rk.get.output.html.file(), append = TRUE)
}

png (...) would take additional arguments width, and height, so we could 
extend rk.graph.on (), to include those parameters (or simply to accept 
a '...'-parameter and pass it on to png ()).
I'll add something to CVS later, and then write back.
Of course SVG-support would be much better. I hope to find the time to look 
into this soon.

> BTW, I posponed my work on the distribution plug-ins. I struggle a lot with
> the graphic part and at some parts I see problems do due a lack of
> theoretical knowledge from my side. Anyway. Kolmogorov-Smirnov,
> Anderson-Darling and some others are on their way.

No problem. Do whatever you feel comfortable with. We should remember to 
revisit some of the existing distribution plugin-ins, though, before the next 
release. As far as I recall, there were some remaining problems (at least 
this one: 
http://sourceforge.net/tracker/index.php?func=detail&aid=1476070&group_id=50231&atid=459007 , 
but possible there were some more small ones? I don't quit remember). Did you 
keep track of what still needs to be improved better than I did?

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20060817/1fa7636a/attachment.sig>


More information about the Rkward-devel mailing list