neighbor: Return the neighbor devices within selected area

Description Usage Arguments Value See Also Examples

View source: R/neighbor.R

Description

neighbor is used when one wants to know the devices within a selected area with a chosen device being the area's center. The device that is interested in as being the center, and the distance will be input in linkneighbor, and a map will be returned for the neighbor devices.

Usage

1
neighbor((mydata = getData('2017-01') , id = '74DA388FF60A' , dist = 3000 , unit = 'm' , zoom = 13))

Arguments

mydata

A data frame which is generated by the function getData. The contents and the column names of the data frame should be the same as the data which is provided in the package.

id

A character implies the device's id that is interested for spatial-anomaly-testing. If the id that is entered does not contain data, the function will stop. The default setting for id is '74DA3895C392'.

dist

A numeric implies the distance that is interested to be included in for spatial-anomaly-testing. An unit can be chose for the "unit" argument, and the default setting is a meter measurement.

unit

A character that implies the unit that should be attached to the numeric distance. "unit" can be either "m" or "km", which represents meter or kilometer. Other inputs are not available for "unit". The default setting is "m", which represents a meter measuring unit.

zoom

map zoom, an integer from 3 (continent) to 21 (building), default value 13. openstreetmaps limits a zoom of 18, and the limit on stamen maps depends on the maptype. "auto" automatically determines the zoom for bounding box specifications, and is defaulted to 10 with center/zoom specifications. maps of the whole world currently not supported. The argument is directly referenced from [Package ggmap version 2.6.1

Value

neighbor returns a map that should contain the device entered, and the neighbor devices in the selected distance. The large red stuffed circle represents the entered device. The blue stuffed squares represent the neighbor devices. The id of the neighbor devices, the longtitude and latitude of the center device would be printed out, as well.

See Also

getData to select the airbox data. week_day to show the boxplot for the concentration of PM2.5. spatial_anomaly to examine for spatial anomaly in PM2.5 concentration.

Examples

1
2
neighbor((mydata = getData('2017-01') , id = '74DA388FF60A' , dist = 3000 , unit = 'm' , zoom = 13))
neighbor()

cclljj/R-AirBox documentation built on May 18, 2019, 5:50 a.m.