[R] Plotting from a list

Steve_Friedman at nps.gov Steve_Friedman at nps.gov
Thu Nov 13 22:30:04 CET 2008


Hi again,

Yes you are right   I should have included an example of the file

It looks like this after reading in the data and using tapply I arrive at
the following

> Alt5rimc_mean
             A      B          C          D          E          F
1965  8.423645  0.208  1.6296296  0.0000000  0.0000000  0.0000000
1966 30.881773 27.344 13.2592593 26.2962963 22.3090909 22.4545455
1967 29.783251 15.824 24.3333333 26.3333333 19.5090909 34.4545455
1968 17.827586 31.776 14.7777778 23.8888889 25.2000000 21.7272727
1969 27.507389 30.520 12.2222222 30.8518519 25.8363636 13.7272727
1970 17.467980 27.232 34.2592593 42.4074074 45.0000000 34.0909091
1971  8.167488  0.000  1.4074074  0.0000000  0.0000000  0.0000000
1972 32.502463 19.736 34.6666667 39.8888889 28.5272727 43.6363636
...
2000 44.610837 11.208  1.7777778 15.6296296 17.8545455  7.5454545

I do not have example code, to share, but I was initially thinking that it
should be approached with as follows:

for (i in 1 to 6)             #  index for columns
  for (j in 1 to 36)        # index for rows

barplot(data[i][j])


But that is very crude and of course it does not work.  Hence the request
for assistance.

Thanks

Steve Friedman Ph. D.
Spatial Statistical Analyst
Everglades and Dry Tortugas National Park
950 N Krome Ave (3rd Floor)
Homestead, Florida 33034

Steve_Friedman at nps.gov
Office (305) 224 - 4282
Fax     (305) 224 - 4147


                                                                           
             "jim holtman"                                                 
             <jholtman at gmail.c                                             
             om>                                                        To 
                                       Steve_Friedman at nps.gov              
             11/13/2008 04:04                                           cc 
             PM EST                    "R help" <R-help at stat.math.ethz.ch> 
                                                                   Subject 
                                       Re: [R] Plotting from a list        
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Yes you can automate it.  The exact way would depend on how your data
is structured and what you want the graphs to look like.  It is hard
to say without an example of the data and at least the command that
your are using to create a single plot.

On Thu, Nov 13, 2008 at 2:16 PM,  <Steve_Friedman at nps.gov> wrote:
>
> Hello,
>
> I am working with version 2.7.2 on a PC and have 2.8.0 available, but
have
> not upgraded completely yet.
>
> I have 6 species for which I've run 6 unique environmental management
> scenarios against for comparison purposes.  Each scenario is run for 36
> years (1965 - 2000).  Some of the species have subpopulations and other
do
> not.   For those with subpopulations (A, B, C, D, E, and F) I have
> calculated basic summary statistics.
>
> I would like to develop a series of barplots  for each scenario year
> consisting of six bars representing the subpopulations.  Rather than
> writing 36 lines of code, I'd like to automate this with a loop process,
>
> Any suggestions ?
>
> Thanks
>
> Steve Friedman Ph. D.
> Spatial Statistical Analyst
> Everglades and Dry Tortugas National Park
> 950 N Krome Ave (3rd Floor)
> Homestead, Florida 33034
>
> Steve_Friedman at nps.gov
> Office (305) 224 - 4282
> Fax     (305) 224 - 4147
>
> ______________________________________________
> 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.
>



--
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list