diff --git a/README-example1-1.pdf b/README-example1-1.pdf new file mode 100644 index 0000000..d343a77 Binary files /dev/null and b/README-example1-1.pdf differ diff --git a/README-exampleout.png b/README-exampleout.png new file mode 100644 index 0000000..f8db89f Binary files /dev/null and b/README-exampleout.png differ diff --git a/README-selectCSV.png b/README-selectCSV.png new file mode 100644 index 0000000..6610736 Binary files /dev/null and b/README-selectCSV.png differ diff --git a/README.Rmd b/README.Rmd index 63843b1..e7c2a78 100644 --- a/README.Rmd +++ b/README.Rmd @@ -1,5 +1,5 @@ --- -output: github_document +output: pdf_document --- ```{r, echo = FALSE} @@ -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") @@ -46,7 +64,7 @@ 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") @@ -54,7 +72,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 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? diff --git a/README.md b/README.md index 5f00324..b69d27f 100644 --- a/README.md +++ b/README.md @@ -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] "-------------------------------------------------------------" @@ -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") @@ -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") diff --git a/README.pdf b/README.pdf new file mode 100644 index 0000000..883f5b5 Binary files /dev/null and b/README.pdf differ diff --git a/vignettes/README-example.png b/vignettes/README-example.png new file mode 100644 index 0000000..f8db89f Binary files /dev/null and b/vignettes/README-example.png differ diff --git a/vignettes/README-selectCSV.png b/vignettes/README-selectCSV.png new file mode 100644 index 0000000..6610736 Binary files /dev/null and b/vignettes/README-selectCSV.png differ diff --git a/vignettes/fbadstats.Rmd b/vignettes/fbadstats.Rmd index 1a13bca..a2af903 100644 --- a/vignettes/fbadstats.Rmd +++ b/vignettes/fbadstats.Rmd @@ -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. @@ -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") ```