/logo-square.png

Google Analytics in R (Part 2)

In case you missed it, here’s part 1 in a nutshell. library(googleAnalyticsR) # Authenticate googleAuthR::gar_auth_service( json_file = "/Users/bgorman/Documents/Projects/R/googleAnalyticsR/gormanalysis-7b0c90a25f87.json", scope = "https://www.googleapis.com/auth/analytics.readonly" ) googleAuthR::gar_set_client( json = "/Users/bgorman/Documents/Projects/R/googleAnalyticsR/client_secret.apps.googleusercontent.com.json", scopes = c("https://www.googleapis.com/auth/analytics.readonly") ) ## 2020-06-24 08:50:08> Setting client.id from /Users/bgorman/Documents/Projects/R/googleAnalyticsR/client_secret.apps.googleusercontent.com.json ## [1] "gormanalysis" # Query list of accounts (to get viewId) accounts <- ga_account_list() accounts[, c("accountName", "webPropertyName", "viewId", "viewName")] ## # A tibble: 1 x 4 ## accountName webPropertyName viewId viewName ## <chr> <chr> <chr> <chr> ## 1 Ben519 GormAnalysis 79581596 All Web Site Data Analyses I think the best way to familiarize yourself with the google analytics API is just to walk through various analyses.

Pulling Shopify Data Into R With shopr

In this tutorial I’ll show you how to use the shopr package to fetch data from a Shopify shop into R. (Not to be confused with the shopifyr package.) Disclaimer I’m the author of shopr. Setup Install shopr The first thing you should do is install the shopr package. I haven’t tried submitting it to CRAN (perhaps I will in the future), so for now you need to install it directly from github.

Google Ads Keyword Matching Guide

I run an online t-shirt shop. I recently noticed that one of my keywords, binary tree shirt, generated a click. Problem is, the person who clicked on my ad was searching for edd china binary t shirt which is distinctively different than the binary tree shirt I’m selling. That money may have been better spent if I threw it in a wishing well. How can I prevent this from happening in the future?

An R User's Guide To Setting Up Python

In this guide I’ll cover how I set up Python with a few tips and tricks to make it an easier transition from R and RStudio. Anaconda We’ll be using the Anaconda distribution to install Python. AFAIK, the main reason Anaconda exists is because it allows you to have multiple instances of Python installed and potentially running at the same time. If you do freelance work like myself, this can be useful if client ABC uses Python 3.

Sparse Matrix Construction And Use In R

In this post, we’ll cover the basics of constructing and using sparse matrices with R’s Matrix package. For background on what sparse matrices are and how they’re stored in compressed formats, check out my previous article Sparse Matrix Storage Formats. Sparse Matrix Construction Sparse Matrix From Base R Matrix library(Matrix) # Build a base R matrix from scratch, comprised of # 0s with probability 0.80 # 1s with probability 0.

Sparse Matrix Storage Formats

Sparse matrices arise natrually in many problems. For example, if we want to predict the price of an item on craigslist using the post’s text, we could build a matrix where each row represents a craigslist post, each column represents a keyword {bad, boat, car, good, new, shoes, used}, and element $ (i,j) $ represents the number of times keyword $ j $ appears in post $ i $. PostId Post post 123 selling my boat post 225 used car for sale.