Skip to content
Prev 313759 / 398506 Next

averaging X of specific Y (latitude)

HI Elaine,

You only provided an object "datam" and the dput(dta).? I don't know what is inside "datam".? Your question "how to use the object "datam" in connection with the code ..." is very confusing.? Do you want to find if datam is a subset of dta or something else?? 

Regarding your other question regaring the row.names(NA, -11L), If you change it manually to row.names(NA,11L), may not make any difference.?? This link might be useful: http://stackoverflow.com/questions/7014387/whats-the-difference-between-1l-and-1

?dta1<-structure(list(Species = structure(1:11, .Label = c("Butterfly A1", 
?"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))
?identical(dta,dta1)
#[1] TRUE
Suppose, you change your row.names:
?dta4<-dta
?row.names(dta4)<-paste0("A",1:11)
?dput(dta4)
structure(list(Species = structure(1:11, .Label = c("Butterfly A1", 
"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("A1", "A2", 
"A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "A11"))

I hope it helps.

A.K.
Message-ID: <1355753453.89984.YahooMailNeo@web142604.mail.bf1.yahoo.com>
In-Reply-To: <CAGJhoDxukjO4rE6AiiXJ4s_y7hf=fa6gTv4zov_j7=qYkNorfA@mail.gmail.com>