Re: [R] Matrix barplot

From: ajay ohri <ohri2007_at_gmail.com>
Date: Fri, 25 Jul 2008 18:57:06 +0530

As a beginner also try downloading the rattle GUI , with all dependecies =true , or R Cmdr GUI..

these are both packages

go to rattle.togaware.com for the rattle instructions and installations

.its very very user friendly even though the purists think its infra dig.(kidding- Friday humour)

Regards,

Ajay Ohri

www.decisionstats.com

On Fri, Jul 25, 2008 at 5:43 PM, Andreas Tille <tillea_at_rki.de> wrote:

> Hi,
>
> as a bloody R beginner I failed to solve the probably simple problem
> to create a barplot of the following data read from a file
>
> Year A B C
> 2000 4 3 0
> 2001 2 1 3
> 2002 1 2 5
>
> The Barplot should look like
>
> 5 | C
> 4 | A C
> 3 | AB C C
> 2 | AB A C BC
> 1 | AB ABC ABC
> +------------------
> 2000 2001 2002
>
> (well, something like that - the colors are encoded as letters in this
> ASCII-graphics - assume the coloring / shading as usual).
>
> My problem is that if I read the table using
>
> data <- read.table(file='data.dat', sep = '\t', fill=TRUE, header=TRUE )
>
> everything looks is read as expected if I try
>
> data
>
> but I have no idea how to separate the Matrix (A B C) to specify the
> height parameter of barplot as a matrix and the names.arg parameter
> for the inscription. Whatever I tried I get
>
> 'height' must be a vector or a matrix
>
> and I have no idea to do this right. So I think I'm just facing a
> data conversion problem and have to turn data[['Year']] into a vector
> and the remaining table into a matrix.
>
> I guess this is a really simple question - but I failed to find a
> solution.
>
> Kind regards
>
> Andreas.
>
> --
> http://fam-tille.de
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 25 Jul 2008 - 13:42:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jul 2008 - 14:32:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive