Skip to content
Prev 313837 / 398503 Next

averaging X of specific Y (latitude)

Hello David,

Thank you for the response.

I changed the e-mail format to text via gmail setting.

1.   the butterfly names
You are right that the butterfly names are stored in the original data.
However, in your code, it is necessary to input the names for the
command structure.
The method I used to input is
1.  display them in the original excel file, as one column with 11 rows.
2.  add commas in a column, right to the name column.
3.  copy the columns of butterfly names and commas, then pasting them
in the wordpad.
4.  copy the wordpad text with butterfly names and commas into your code

Since the method sounds tedious, particularly when the number of
butterfly names increases over 11,
I would like to ask for less time-consuming method to elicit butterfly
names as factor.
(Maybe using some R command I do not know)

2. Latitude degree
Thank you for helping generate the mean of range size per latitudinal
degree, using the code:\
Bfly <- aggregate(Range~floor(Latitude), dta, mean)

Please kindly advise if it is possible to calculate the mean of range
size per 5 latitudinal degrees,
such as 6-10, 11-15, or 16-20 latitudinal degrees.

Thank you again.

Elaine
+ "Butterfly A2", "Butterfly A3", "Butterfly A4", "Butterfly B1",
+ "Butterfly B2", "Butterfly B3", "Butterfly B4", "Butterfly B5",
+ "Butterfly C1", "Butterfly C2"), class = "factor"), Range = 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(NA, -11L))
Species Latitude    Mean
1  Butterfly A1        9  130.50
2  Butterfly A3        9 1102.38
3  Butterfly A2       10  450.68
4  Butterfly B1       10  820.20
5  Butterfly B2       10  872.20
6  Butterfly B5       12  982.78
7  Butterfly C1       12  720.32
8  Butterfly A4       16  893.34
9  Butterfly B3       16  488.20
10 Butterfly B4       18  620.11
11 Butterfly C2       18  912.20

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
On Tue, Dec 18, 2012 at 11:07 AM, David L Carlson <dcarlson at tamu.edu> wrote: