Hi R-listers, 

I am trying to group my HTL data, this is a column of data of "Distances to
the HTL" data = turtlehatch. I would like to create an Index of distances
(0-5m, 6-10, 11-15, 16-20... up to 60). And then create a new file with this
HTLIndex in a column. 

So far I have gotten this far:

HTL.index <- function (values, weights=c(0, 5, 10, 15, 20, 25, 30, 35, 40,
45, 50, 55, 60)) {
hope <-values * weights
return (apply(hope, 1, sum)/apply(values, 1, sum))
}
write.csv(turtlehatch, "HTLIndex", row.names=FALSE)
----

But I do not seem to be able to create a new column " in a new file. 

Please advise, Jean



--
View this message in context: 
http://r.789695.n4.nabble.com/Grouping-distances-tp4632984.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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