WGround-class: WGround: Objects for representing weather data.

Description Usage Arguments Slots Author(s) Examples

Description

A class to query the weather data of a place from multiple Personal Weather Stations

Generic Method for getPWSinfo defined

Method of class WGround to get PWS data for a location Return object with data frame with pws info. Throws an error if object is invalid.

Generic Method for CurrentWeatherbyPWS defined

Method of class WGround to get Current weather conditions Return object with data frame with conditions. Throws an error if object is invalid.

Generic Method getHistoricalWeather defined

Method of class WGround to get Historical weather data Return data frame with historical weather data. Throws an error if object is invalid.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
getPWSinfo(object, verbose = TRUE, distance_mi = numeric(0),
  maxPWScount = numeric(0))

## S4 method for signature 'WGround'
getPWSinfo(object, verbose = TRUE,
  distance_mi = numeric(0), maxPWScount = numeric(0))

CurrentWeatherbyPWS(object, verbose = TRUE)

## S4 method for signature 'WGround'
CurrentWeatherbyPWS(object, verbose = TRUE)

getHistoricalWeather(object, startDt, endDt, maxPWScount = 3,
  verbose = TRUE)

## S4 method for signature 'WGround'
getHistoricalWeather(object, startDt, endDt,
  maxPWScount = 3, verbose = TRUE)

Arguments

object

the WGround object

verbose

mode

distance_mi

distance from specified location

maxPWScount

maximum number of PWS received

startDt

start date for historical data

endDt

end date for historical data

Slots

APIkey

API key from Wunderground website

city

A valid city name

country

A valid country name

state

A valid US state name

pws

A data frame of all PWS

selectedpws

A data frame of user selected PWS

conditions

A data frame of current conditions for selected PWS

runmode

online or offline, default: online

Author(s)

Siddhartha Jetti - 50% & Atul Lal - 50%

Examples

1
2
3
4
5
6
7
8
obj <- new("WGround", city="Fremont",state= "CA",runmode="offline")
obj <- getPWSinfo(obj,verbose=FALSE)

obj@selectedpws <- obj@pws[obj@pws$id == 'KCAFREMO83'|obj@pws$id == 'KCAFREMO88',]
obj <- CurrentWeatherbyPWS(obj,verbose=FALSE)

df_hist <- getHistoricalWeather(obj,verbose=FALSE,startDt="2017/01/01",endDt="2017/01/01")
head(df_hist,5)

siddhujetty/rpwsdata documentation built on May 29, 2019, 9:58 p.m.