[RkWard-devel] Wikipedia greek
I. Soumpasis
nono.231 at gmail.com
Wed Jan 31 19:18:42 UTC 2007
2007/1/31, Thomas Friedrichsmeier <thomas.friedrichsmeier at ruhr-uni-bochum.de
>:
>
> On Tuesday 30 January 2007 16:09, I. Soumpasis wrote:
> > > rainbox (length (rk.temp.x))
> >
> > I believe you mean rainbow.
>
> Indeed.
>
> > I made some research on this. I used VADeaths
> > data. The results are shown on pdf. The length() does not seem to solve
> the
> > problem but create another as you will see at the attached pdf. The
> problem
> > seems to relates to the beside option because with the stacked plots
> there
> > is no problem. Any other testing I have done, with any kind of variables
> > seems to be right.
>
> I think the difference between juxtaposed and stacked is simply that
> barplot
> will restart coloring at the first color for stacked plots, but not for
> juxtaposed ones.
>
> > Can I have some other data were the problem seems to appear? Did anybody
> > find any similar problem?
>
> This one is an example of a problematic matrix:
> x <- matrix (1:20, nrow=4, ncol=5)
> Here the first value of x is 1, so only one color will ever be used (in
> either
> type of barplot).
>
> > Is there any other suggestions of how to fix this?
>
> I guess the proper solution would be to use either dim (x)[1] or is that
> is
> null (for vectors, and factors), use length (x). E.g.:
>
> rainbow (if (is.null (dim(rk.temp.x)) length (rk.temp.x) else dim (
> rk.temp.x)
> [1])
I did something a little bit different, however the dim() was what needed I
think. Here is the code
col=rainbow( if(is.matrix(rk.temp.x)) dim(rk.temp.x) else rk.temp.x)
Since the only problem was with matrix, that fixes it. For summary of factor
variables both length(rk.temp.x) and rk.temp.x work correctly. However with
simple vectors the length(rk.temp.x) does not work correctly giving one
color per value. So I prfered the simple rk.temp.x. I send a pdf with
example plots to take a look. I think it is ok now. I will commit it to svn
in few minutes.
Regards,
Ilias
Not much time to experiment with it, however. You may have to try some
> variations in order to get everything right. Also, maybe take a look at
> barplot.default to figure out, how they determine the number of gray
> shades
> to use.
>
> > P.S. Something irrelevant but it came to mind printing the output. Is
> there
> > a way to skip printing the file:///home/user/.rkward/rk_out.html? Just a
> > suggestion.
>
> Could you rephrase? I did not understand, what you mean.
>
> Regards
> Thomas
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> RKWard-devel mailing list
> RKWard-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rkward-devel
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20070131/0d8e06c8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: barplot.pdf
Type: application/pdf
Size: 71099 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20070131/0d8e06c8/attachment.pdf>
More information about the Rkward-devel
mailing list