Skip to content
Prev 83355 / 398513 Next

use of tapply?

[tom wright]
I'll try! :-)
Using `di' instead of `data.intersects' for short:

    di <- data.frame(x=c(0.230, 0.411, 0.477, 0.241, 0.552, 0.230),
                     y=c(0.119, 0.515, 0.261, 0.431, 0.304, 0.389),
                     row.names=c('tbr', 'trg', 'dbr', 'dbg', 'pbr', 'pbg'))
    di.c <- with(di, data.frame(x=x-0.34,  y=y-0.36))
    di$length <- with(di.c, sqrt(x^2 + y^2))
    di$angle <- with(di.c, atan2(y, x))