-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
106 lines (95 loc) · 3.1 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
```{r, include=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
devtools::load_all()
```
# spitcastr
[![Travis](https://img.shields.io/travis/sboysel/spitcastr.svg?style=flat-square)](https://travis-ci.org/sboysel/spitcastr)
[![Codecov](https://img.shields.io/codecov/c/github/sboysel/spitcastr.svg?style=flat-square)](https://codecov.io/github/sboysel/spitcastr)
[![GitHub
license](https://img.shields.io/github/license/sboysel/spitcastr.svg?style=flat-square)](https://github.com/sboysel/spitcastr/blob/master/LICENSE)
An `R` client for the [Spitcast Surf Forecast
API](http://www.spitcast.com/api/docs/).
## Usage
Install `spitcastr`
```{r install, eval=FALSE}
# install.packages("devtools")
devtools::install_github("sboysel/spitcastr")
library(spitcastr)
```
### County
List the spots in a county
```{r county_spots}
library(dplyr)
county(item = "spots", county_name = "Orange County") %>%
dplyr::tbl_df()
```
List swell forecasts for a particular county
```{r county_swell}
county(item = "swell", county_name = "Orange County") %>%
dplyr::tbl_df()
```
Get tide predictions for a particular county
```{r county_tide}
county(item = "tide", county_name = "Orange County") %>%
dplyr::tbl_df()
```
Get water temperature for a particular county
```{r county_temp}
county(item = "temp", county_name = "Orange County") %>%
dplyr::tbl_df()
```
Get wind speed predictions for a particular county
```{r county_wind}
county(item = "wind", county_name = "Orange County") %>%
dplyr::tbl_df()
```
### Spots
List all spots
```{r spot_all, warning=FALSE, message=FALSE}
spot(item = "all") %>%
dplyr::tbl_df() %>%
dplyr::filter(county_name == "Santa Barbara")
```
Get the forecast for a specific spot
```{r spot_forecast}
spot(item = "forecast", spot_id = 183) %>%
dplyr::tbl_df()
```
List spot near your location
```{r spot_nearby}
spot(item = "nearby") %>%
dplyr::tbl_df()
```
List neighbors of a given spot
```{r spot_neighbors}
spot(item = "neighbors", spot_id = 1, direction = "above") %>%
dplyr::tbl_df()
```
Search for a spot with a sequence of parameters
```{r spot_search_forecast}
spot(item = "search", size_min = 3, size_max = 8, shape_min = 1) %>%
dplyr::tbl_df()
```
List top spots
```{r spot_top}
spot(item = "top") %>%
dplyr::tbl_df()
```
## Resources
* [Spitcast Surf Forecast API Documentation](http://www.spitcast.com/api/docs/)
Be sure to checkout [Spitcast](http://www.spitcast.com/) and read the ['fine
print'](http://www.spitcast.com/api/docs/):
> Public distribution of Spitcast API content must acknowledge Spitcast as
> the content source, and provide a link to Spitcast.com.
> The Spitcast API is available for non-commercial use. Commercial use is
> possible by prior arrangement.
> The Spitcast API is available for low request volume use. Please cache API
> responses. Please also make API requests to api.spitcast.com, and NOT to
> www.spitcast.com.
> The Spitcast API is experimental and is currently offered on an ad hoc basis
> with no guarantee of uptime or availability of continued service. We reserve
> the right to disable access to external applications at any time.