Hi John , Petr and R users
I am sorry that my data was not readable formate in the last email. Again I am 
trying to send it. hope this time, that  table can be readable.As I mentioned 
earlier that I was struggling to figure out on how I can calculate the average 
from the two tables in R. Any one can help me? really your helpwould be 
grateful- I am spending so much time to figure it out. It should not be so 
hard, I think.I have very big data but I have created a hypothetical data for 
simplification.for exampleI have : table 1Table 1: species occurrence data> 
table1      X speciesX speciesY speciesZ speciesXX1 Plot1        1        0     
   1         02 Plot2        0        1        1         03 plot3        1      
  0        0         14 plot4        0        0        1         0Table 2: 
table 2. species tolerance data>table2                  X EnviA EnviB EnviC1  
SpeciesX  0.21  0.40  0.172  SpeciesY  0.10  0.15  0.183 SpeciesXY  0.14  0.16  
0.19You may noticed that table 2 does not have species Z wh!
 ich was in tableTable 3: Now I want to get the average value of species 
tolerance in each plot based on each environmental value (EnviA or EnviB 
etc).The example of the out come (final table I was looking for it).Results 
table 1a: averages species tolerance in each plot based on EnviAsuch as: > 
table3.a      X speciesX speciesY speciesZ speciesXX average1 plot1     0.21    
   NA   Nodata      0.14   0.1752 plot2       NA      0.1   Nodata        NA   
0.1003 plot3       NA       NA   Nodata      0.14   0.1404 plot4     0.21       
NA   Nodata        NA   0.210Table 4> table3.b: Result table 1b: average 
species tolerance in plot based on EnviB      X speciesX speciesY speciesZ 
speciesXX average1 plot1      0.4       NA   Nodata      0.16    0.282 plot2    
   NA     0.15   Nodata        NA    0.153 plot3       NA       NA   Nodata     
 0.16    0.164 plot4      0.4       NA   Nodata        NA    0.40I hope this 
time the data would be readable formate. Would any one help me how I!
  can calculate these?ThanksKristi Golver==
> To: kristi.glo...@hotmail.com
> CC: r-help@r-project.org
> Subject: Re: [R] averaging two tables (rows with columns)
> From: petr.pi...@precheza.cz
> Date: Thu, 10 May 2012 18:10:33 +0200
> 
> Hi
> 
> as already mentioned your data can not be deciphered. Use
> 
> dput(table1) for sending usable data.
> 
> From what you describe probably
> 
> ?aggregate can be used.
> But without suitable data you hardly get any advice.
> 
> Regards
> Petr

                                          
        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to