Description Arguments Details Value See Also Examples
Gets the nearby PWS (personal weather station) from http://www.wunderground.com based on a original search location and a distance range.
lat |
a numeric that specifies the latitude of the original search location; must be between -180 and 180 |
lon |
a numeric that specifies the longitude of the original search location; must be between -180 and 180 |
zipcode |
a numeric that specifies the zipcode of the original search location; only valid for locations within USA |
city |
a single character string that specifies the city of the original search location |
state |
a single character string that specifies the state of the original search location; should be supplied if the location is within USA |
country |
a single character string that specifies the country of the original search location; should be supplied if the location is outside USA |
distance |
a positive numeric which specifies the distance range of the nearby PWS from the original search location |
Three methods of specifying a original search location are defined. The function first searches the location by lat and lon if they are supplied. If lat and lon are not supplied, the function next searches the location by the zipcode if it is supplied. If again zipcode is not supplied, then the function searches the location by the city. If state is supplied, then the city will be searched within the USA. Otherwise if country is supplied, then the city will be searched outside the USA.
The function then gets the nearby PWS of the original search location within a distance range which is specified by distance.
An S4 object of class PWS-class containing the information about the original search location and the nearby PWS. The object contains the following slots:
citya single character string that shows the city of the original search location
statea single character string that shows the state of the original search location; is character(0) if the origin is outside the U.S.A
countrya single character string that shows the country of the original search location; is character(0) if the the origin is within the U.S.A
lata numeric that shows the latitude of the original search location; must be between -180 and 180
lona numeric that shows the longitude of the original search location; must be between -180 and 180
dataa data frame that contains the information of the nearby PWS; in particular, the columns of the data frame should be:
neighborhooda single character string that shows the neighborhood of the PWS
citya single character string that shows the city of the PWS
statea single character string that shows the state of the PWS
countrya single character string that shows the country of the PWS
ida numeric that shows the id of the PWS
lata numeric that shows the latitude of the PWS
lona numeric that shows the longitude of the PWS
distance_kma positive integer that shows the distance from the PWS to the original search location in kilometers
distance_mia positive integer that shows the distance from the PWS to the original search location in miles
see PWS-class for more details
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.