Skip to content

Commit

Permalink
version bumb to provide sample data so that the vignette builds succe…
Browse files Browse the repository at this point in the history
…ssfuly even when the api call fals for any reason.
  • Loading branch information
novica committed May 6, 2021
1 parent 9611108 commit 8d125b7
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 12 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: windsoraiR
Title: Access the 'Windsor.ai' API
Version: 0.1.1
Version: 0.1.2
Authors@R:
c(person(given = "Novica",
family = "Nakov",
Expand Down Expand Up @@ -31,3 +31,4 @@ Suggests:
ggplot2,
tidyr,
curl
LazyData: true
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# windsoraiR 0.1.2

* Added sample data for the vignette.

# windsoraiR 0.1.1

* Added a more meaningful description.
Expand Down
16 changes: 16 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#' Sample data from the Windsor API.
#'
#' A dataset containing sample gooole and facebook ads data
#' fetched from windsor.ai API. See more at: https://www.windsor.ai/api-fields/
#'
#' @format A data frame with 1677 rows and 6 variables:
#' \describe{
#' \item{data.campaign}{name of the campaign}
#' \item{data.clicks}{number of clicks}
#' \item{data.spend}{spend data}
#' \item{data.medium}{the type of referals}
#' \item{data.source}{source of the data (google, facebook, etc.)}
#' \item{googlesheets}{googlesheets id}
#' }
#' @source \url{http://www.windsor.ai/}
"my_data"
Binary file added data/my_data.rda
Binary file not shown.
28 changes: 28 additions & 0 deletions man/my_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 4 additions & 11 deletions vignettes/basics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ The goal here is to outline in a couple of paragraphs and few lines of code some

After we create an account at Windsor.ai and obtain an API key, collecting our data from Windsor to R is as easy as:

```{r, echo = FALSE}
library(windsoraiR)
my_data <-
windsor_fetch(
api_key = "c0eae325c8fb85a0c256da2cd08a27e81972",
date_preset = "last_7d",
fields = c("source", "campaign", "clicks",
"medium", "sessions", "spend")
)
```


```{r, eval = FALSE}
library(windsoraiR)
Expand All @@ -47,6 +36,10 @@ my_data <-

Lets take a peek at the data we just downloaded to get a better idea about the structure and type of information included.

```{r, echo = FALSE}
library(windsoraiR)
```

```{r}
str(my_data)
```
Expand Down

0 comments on commit 8d125b7

Please sign in to comment.