getWeatherData: A user function for getting a list of weather reports for...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

A user provides a city name and a radius. This function then goes and finds weather stations within the specified radius.

Usage

1
getWeatherData(locale = "Montreal,CA", distance = 20, statLimit = 150)

Arguments

locale

A city/state/country name

distance

A distance/radius in miles

statLimit

A limit on the number of stations to be returned

Details

None

Value

An S4 object containing weather information for each personal weather station found

Note

None

Author(s)

Steve Pittard <wsp@emory.edu>

References

STATS290 Website

See Also

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## The function is currently defined as
function (locale = "Montreal,CA", distance = 20, statLimit = 150) 
{
    .onLoad = function(libname, pkgname) {
        .libPaths("~wpittard/Library")
        require("svMisc")
    }
    myLocs = getLatLon(locale, distance)
    myStats = getStations(myLocs$locs, myLocs$iradius, statLimit)
    if (length(myStats) == 0) {
        stop("Sorry. No stations found within the specified radius")
    }
    baseStat = myStats[1]
    myWeatherObj = getWeather(myStats, myLocs$mlat, myLocs$mlon, 
        myLocs$iradius, myLocs$origCity, baseStat)
  }

steviep42/PWS documentation built on May 30, 2019, 5:39 p.m.