README.md

weatheR

Build Status

Contributors

Overview

This package provides four useful wrapper functions around the OpenWeatherMap API. The four functions are: distmap(), cloudmap(), get_weather(), get_weather_four_days() and cwd().

api - User's API

city1 - Name of a city (lowercase)

city2 - Name of a city (lowercase)

*Value:*

Returns a string telling the user the distance between two cities in km

Arguments:

`api` - User's API

`city` - Name of a city (lowercase)

`dense` - Transparency of points

Value:

Returns a response. This will be of a character type.

Installation

Install this package directly from GitHub:

devtools::install_github("UBC-MDS/weatheR")

Usage

Simple example demonstrating the functionality of this package:

# load package
library(weatheR)

api <- "&APPID=8196eccade1594d99afd30e0924dca7d"

# Calculate distance between two cities
distmap(api, 'vancouver', 'toronto')

# Returns a plot showing how dense clouds are in the area
cloudmap(api, 'alberta', dense = 0.2 )

# Returns weather forecast for the next 24 hours for selected city
get_weather(api, city):

# Returns 4-day weather forecast for selected city
get_weather_four_days(api, 'Vancouver')

# Get current weather description
cwd(api,"Vancouver,CA")


UBC-MDS/weatheR documentation built on May 21, 2019, 12:03 p.m.