Skip to content

Commit

Permalink
added use of folder and file-specific selection to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rick Pack committed Feb 2, 2018
1 parent 8f10711 commit aeb67bb
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 13 deletions.
Binary file added README-example1-1.pdf
Binary file not shown.
Binary file added README-exampleout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README-selectCSV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 23 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
output: github_document
output: pdf_document
---

```{r, echo = FALSE}
Expand Down Expand Up @@ -32,8 +32,26 @@ library("devtools")
## Install FBadstats
devtools::install_github("RickPack/FBadstats")
```

### Example 1/3
#### Easiest use - select a file or folder
The easiest use is to call the function, navigate to your exported CSV file and then select it. The default parameters may give you all you need.
## Call the function
```{r, message=FALSE, echo=FALSE}
## load the package
library(FBadstats)
print(getwd())
```
```{r, message=FALSE, eval=FALSE}
fbadGstats()
```
## Select your file
![Windows Explorer file-selection](README-selectCSV.png)
## Use the output
![Portion of fbadGstats output](README-exampleout.png)
You can select a folder and process all of the .CSV files with:
```{r, message=FALSE, eval=FALSE}
fbadGstats(choosedir="YES")
```
### Advanced Example 1/3
```{r example1, fig.width = 10, fig.height = 4.5, fig.align = 'center'}
## Load FBadstats
library("FBadstats")
Expand All @@ -46,15 +64,15 @@ Here we see BOTH [default for tblout parameter] the top 3 and worst 3 Age / Gend
At least two events (clicks) must have occurred. Otherwise an anomalous single event for 25-34 males causes that group to appear.
"Hotreg" indicated where selected regions with a history of performing well were the only ones targeted with the advertisement.

### Example 2/3
### Advanced Example 2/3
```{r example2, fig.width = 10, fig.height = 4.5, fig.align = 'center'}
fbadGstats(filerd = "example_PerfClk_AgeGender.csv", filtervar = 'hotreg', prtrow = 3, minevent = 2, grphout = "NO")
fbadGstats(filerd = "example_PerfClk_AgeGender.csv", filtervarneg = 'hotreg', prtrow = 3, minevent = 2, grphout = "NO")
```

## Assign fbadGstats call to a variable in order to explore the data outside of fbadGstats

### Example 3/3
### Advanced Example 3/3
```{r example3, fig.width = 10, fig.height = 4.5, fig.align = 'center'}
myfbfrm <- fbadGstats(filerd = "example_PerfClk_AgeGender.csv", filtervar = 'AllPg', grphout = "NO")
## What are all of the available ad set names?
Expand Down
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,30 @@ library("devtools")
devtools::install_github("RickPack/FBadstats")
```

### Example 1/3
#### Easiest use - select a file or folder

The easiest use is to call the function, navigate to your exported CSV file and then select it. The default parameters may give you all you need. \#\# Call the function

#> [1] "C:/Users/Packr1/Documents/Personal/fbadstats"

``` r
fbadGstats()
```

Select your file
----------------

![Windows Explorer file-selection](README-selectCSV.png) \#\# Use the output ![Portion of fbadGstats output](README-exampleout.png) You can select a folder and process all of the .CSV files with:

``` r
fbadGstats(choosedir="YES")
```

### Advanced Example 1/3

``` r
## Load FBadstats
library("FBadstats")
#> FB Ads Analysis tool: 'fbadGstats' - Breakdown Group analysis function
# Show only the best performing groups and include the graphical output
fbadGstats(filerd = "example_DMA.csv", grphout = "YES", tblout = "BEST")
#> [1] "-------------------------------------------------------------"
Expand Down Expand Up @@ -68,7 +86,7 @@ Here we see BOTH \[default for tblout parameter\] the top 3 and worst 3 Age / Ge
At least two events (clicks) must have occurred. Otherwise an anomalous single event for 25-34 males causes that group to appear.
"Hotreg" indicated where selected regions with a history of performing well were the only ones targeted with the advertisement.

### Example 2/3
### Advanced Example 2/3

``` r
fbadGstats(filerd = "example_PerfClk_AgeGender.csv", filtervar = 'hotreg', prtrow = 3, minevent = 2, grphout = "NO")
Expand Down Expand Up @@ -106,7 +124,7 @@ fbadGstats(filerd = "example_PerfClk_AgeGender.csv", filtervarneg = 'hotreg', pr
Assign fbadGstats call to a variable in order to explore the data outside of fbadGstats
---------------------------------------------------------------------------------------

### Example 3/3
### Advanced Example 3/3

``` r
myfbfrm <- fbadGstats(filerd = "example_PerfClk_AgeGender.csv", filtervar = 'AllPg', grphout = "NO")
Expand Down
Binary file added README.pdf
Binary file not shown.
Binary file added vignettes/README-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vignettes/README-selectCSV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 19 additions & 4 deletions vignettes/fbadstats.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,25 @@ options(width = 750)
The `fbadGstats` function aggregates across all of the Facebook (FB) ads performance data one provides from FB Ads Manager and indicates the best and worst performers per subgroup / breakdown group. *Disclaimer: This function and the entire `FBadstats` package are not supported or endorsed by Facebook, Inc. Only the user is responsible for its use.*

## How to use `fbadGstats`

#### Easiest use - select a file or folder
The easiest use is to call the function, navigate to your exported CSV file and then select it. The default parameters may give you all you need.
## Call the function
```{r, message=FALSE, echo=FALSE}
## load the package
library(FBadstats)
```
```{r, message=FALSE, eval=FALSE}
fbadGstats()
```
## Select your file
![Windows Explorer file-selection](README-selectCSV.png)
## Use the output
![Portion of fbadGstats output](README-example.png)
You can select a folder and process all of the .CSV files with:
```{r, message=FALSE, eval=FALSE}
fbadGstats(choosedir="YES")
```
#### Advanced use - use one of the >10 parameters
We will first use the included **example_PerfClk_AgeGender** CSV file that represents exported data from ads dedicated to acquiring "Leads" (email addresses for potential customers AKA "an email funnel").

The "PerfClk" in the name indicates that the "Performance and Clicks" view was used in Ads Manager at the time of the export, which is the best view to first try - others may fail. I will add to the error messages over time so one better understands why a view failed, and a view may succeed as the function evolves. The "AgeGender" in the filename expresses that the selected breakdown was a *combination* of age and gender.
Expand All @@ -27,9 +45,6 @@ The "PerfClk" in the name indicates that the "Performance and Clicks" view was u
Setting the `tblout` parameter to BOTH causes the best and worst performers to appear in the table
**Note:** The filerd parameter, if used, must have the full path to a CSV file with slashes, not backslashes (e.g., `filerd` = *'c:/users/Users/RickPack/Documents/R/LeadData.csv'*).
Example files included with the `FBadstats` package are exceptions.
```{r, message=FALSE}
## load the package
library(FBadstats)
## now call the function and provide parameters as desired
fbadGstats(filerd = "example_PerfClk_AgeGender.csv", grphout = "NO", tblout = "BOTH")
```
Expand Down

0 comments on commit aeb67bb

Please sign in to comment.