View source: R/xyFrom2PointLine.R
xyFrom2PointLine | R Documentation |
This function extract the values or the xy coordinate of a line passing through two points.
xyFrom2PointLine(
r = NULL,
points = data.frame(x = c(0, 1), y = c(0, 1)),
step = NULL,
radius = NA,
angle = NA,
units_angle = c("deg", "rad"),
fun = NULL,
...
)
r |
a Raster* object |
points |
data frame containing x and y coordinaates from start and end point |
step |
step used for the extraction of the segment points |
radius |
length of the segment from the start point (optional) |
angle |
angle direction of the segment from the start point (optional). It is counterclockwise from East. |
units_angle |
string measurement unit |
fun |
optional aggregation function. Default is |
... |
further arguments for |
xy_A <- xyFrom2PointLine(points=data.frame(x=c(0,1),y=c(0,1)),step=0.1)
dem <- raster(system.file("dem/dem_rendena.asc",package="horizons"))
xP <- (xmax(dem)*0.4+xmin(dem)*0.6)
yP <- (ymax(dem)*0.4+ymin(dem)*0.6)
xy_B <- xyFrom2PointLine(r=dem,points=data.frame(x=xP,y=yP),radius=10000,angle=35,units_angle="deg")
max_xy_B <- xyFrom2PointLine(r=dem,points=data.frame(x=xP,y=yP),radius=10000,angle=35,units_angle="deg",fun=max,na.rm=TRUE)
min_xy_B <- xyFrom2PointLine(r=dem,points=data.frame(x=xP,y=yP),radius=10000,angle=35,units_angle="deg",fun=min,na.rm=TRUE)
median_xy_B <- xyFrom2PointLine(r=dem,points=data.frame(x=xP,y=yP),radius=10000,angle=35,units_angle="deg",fun=median,na.rm=TRUE)
median_xy_BA <- xyFrom2PointLine(r=brick(dem,dem+1),points=data.frame(x=xP,y=yP),radius=10000,angle=35,units_angle="deg",fun=median,na.rm=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.