cut_data: Cut 2d data

Description Usage Arguments Value Author(s) Examples

View source: R/cut_data.R

Description

Cut a 2d dataframe based on a point and a side length of a square.

Usage

1
cut_data(x, y, data, df.x = "x", df.y = "y", side.length)

Arguments

x

Longitude coordinates in decimal degrees for the reference point.

y

Latitude coordinates in decimal degrees for the reference point.

data

data.frame with the observations that will be cut. This data.frame should have at least two columns: x and y.

df.x

Name of the column in the dataframe which includes the x coordinates in decimal degrees for each observation. Default is set to "x".

df.y

Name of the column in the dataframe which includes the latitude coordinates in decimal degrees for each observation.

side.length

Side length in decimal degrees of the sorrunding box that will cut the spatial 2d dataframe.

Value

A subset of data.

Author(s)

Ricardo Ochoa Sosa

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
my.data <-
read.table(header = TRUE, text = "
x	y	variable
-99.495	19.16	1
-99.490	19.16	5
-99.500	19.14	2
-99.490	19.15	10
")

cut_data(x = -99.490, y = 19.16, data = my.data, side.length = 0.01)

ricardoochoa/urban.context documentation built on May 27, 2019, 7:41 a.m.