Re: [R] averaging X of specific Y (latitude)

2012-12-18 Thread arun
es #  Rangesize Mean #1  6-10 675.1920 #2 11-15 851.5500 #3 16-20 728.4625 A.K. - Original Message - From: Elaine Kuo To: dcarl...@tamu.edu Cc: r-help@r-project.org Sent: Tuesday, December 18, 2012 1:39 AM Subject: Re: [R] averaging X of specific Y (latitude) Hello David,

Re: [R] averaging X of specific Y (latitude)

2012-12-18 Thread David L Carlson
sity College Station, TX 77843-4352 > -Original Message- > From: Elaine Kuo [mailto:elaine.kuo...@gmail.com] > Sent: Tuesday, December 18, 2012 12:39 AM > To: dcarl...@tamu.edu > Cc: r-help@r-project.org > Subject: Re: [R] averaging X of specific Y (latitude) > > Hel

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
88.20 > >> 10 Butterfly B4 18 620.11 > >> 11 Butterfly C2 18 912.20 > >> > On Tue, Dec 18, 2012 at 12:27 AM, David L Carlson wrote: > You are only using dput to create a version of your data that you can post > in your email along with your quest

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread David L Carlson
lege Station, TX 77843-4352 From: Elaine Kuo [mailto:elaine.kuo...@gmail.com] Sent: Monday, December 17, 2012 6:37 PM To: dcarl...@tamu.edu Cc: r-help@r-project.org Subject: Re: [R] averaging X of specific Y (latitude) Thank you, David. Now I know how to use dput.  Two more questions conjure

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
the data that is easy for r-help subscribers to use in > order to recreate your data. That makes it easier to answer your question. > **** > > ** ** > > ------ > > David L Carlson > > Associate Professor of Anthropology > &

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread David L Carlson
tion, TX 77843-4352 From: Elaine Kuo [mailto:elaine.kuo...@gmail.com] Sent: Monday, December 17, 2012 5:56 AM To: dcarl...@tamu.edu; r-help@r-project.org Subject: Re: [R] averaging X of specific Y (latitude) Another question (I am sure it is the last one tentatively): After creati

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread arun
ange = c(130.5, 450.68, 1102.38, 893.34, 820.2, 872.2, 488.2, 620.11, 982.78, 720.32, 912.2), Latitude = c(9.45, 10.2, 9.3, 16.4, 10.54, 10.87, 16.79, 18.3, 12.98, 12.67, 18.07)), .Names = c("Species", "Range", "Latitude"), class = "data.frame", row.names = c(&

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
2.78, > + 720.32, 912.2), Latitude = c(9.45, 10.2, 9.3, 16.4, 10.54, 10.87, > + 16.79, 18.3, 12.98, 12.67, 18.07)), .Names = c("Species", "Range", > + "Latitude"), class = "data.frame", row.names = c(NA, -11L))) > > > >>> >> >>

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
A, -11L))) >> >> >> >> >> >> - Original Message - >> >> From: David L Carlson >> >> To: 'Elaine Kuo' ; r-help@r-project.org; >> >> 'r-sig-geo' >> >> Cc: >> >> Sent: Sunday, Decem

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
bining species within a > >> latitude just remove Species: > >> > >>> aggregate(Range~floor(Latitude), dta, mean) > >> floor(Latitude) Range > >> 1 9 616.440 > >> 2 10 714.360 > >> 3 12 851.550 > &

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Berend Hasselman
>>> aggregate(Range~floor(Latitude), dta, mean) >> floor(Latitude) Range >> 1 9 616.440 >> 2 10 714.360 >> 3 12 851.550 >> 4 16 690.770 >> 5 18 766.155 >> >> ------- >>

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
12 851.550 > 4 16 690.770 > 5 18 766.155 > > --- > David > > > From: Elaine Kuo [mailto:elaine.kuo...@gmail.com] > Sent: Sunday, December 16, 2012 5:17 PM > To: dcarl...@tamu.edu; r-help@r-project.org; r-sig-...@stat.math.ethz.ch >

Re: [R] averaging X of specific Y (latitude)

2012-12-16 Thread arun
-...@stat.math.ethz.ch Cc: Sent: Sunday, December 16, 2012 6:16 PM Subject: Re: [R] averaging X of specific Y (latitude) Thank you, David. Your answer reminded me of rearranging the order according to the latitude before running the calculation. One more question, please kindly help with the code to

Re: [R] averaging X of specific Y (latitude)

2012-12-16 Thread David L Carlson
ced before the mean calculation? Thank you. Elaine - Original Message - From: David L Carlson To: 'Elaine Kuo' ; r-help@r-project.org; 'r-sig-geo' Cc: Sent: Sunday, December 16, 2012 11:32 AM Subject: Re: [R] averaging X of specific Y (latitude) It is better to us

Re: [R] averaging X of specific Y (latitude)

2012-12-16 Thread Elaine Kuo
calculation? Thank you. Elaine > > > > - Original Message - > From: David L Carlson > To: 'Elaine Kuo' ; r-help@r-project.org; > 'r-sig-geo' > Cc: > Sent: Sunday, December 16, 2012 11:32 AM > Subject: Re: [R] averaging X of specific Y (latit

Re: [R] averaging X of specific Y (latitude)

2012-12-16 Thread arun
.org; 'r-sig-geo' Cc: Sent: Sunday, December 16, 2012 11:32 AM Subject: Re: [R] averaging X of specific Y (latitude) It is better to use dput() in R to create a text version of your data for us to work with. The aggregate command below gives you the mean ranges by butterfly species an

Re: [R] averaging X of specific Y (latitude)

2012-12-16 Thread David L Carlson
It is better to use dput() in R to create a text version of your data for us to work with. The aggregate command below gives you the mean ranges by butterfly species and latititude and saves the result as Bfly. The colnames() command simply renames the columns: > dta <- structure(list(Species = st