ga_model: Use a model

Description Usage Arguments See Also Examples

View source: R/models.R

Description

Use a model created by ga_model_make

Usage

1
ga_model(viewId, model, load_libs = TRUE, ...)

Arguments

viewId

The GA viewId to operate on

model

A file location of a model object or a model object created by ga_model_make

load_libs

Whether to load the library requirements into your namespace

...

Other arguments to pass into the model as needed

See Also

Other GA modelling functions: ga_model_edit(), ga_model_example(), ga_model_load(), ga_model_make(), ga_model_save(), ga_model_shiny_load(), ga_model_shiny_template(), ga_model_shiny(), ga_model_write()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# models that come with the package
ga_model_example()
## Not run: 

# your own Google Analytics viewID
my_viewid <- 81416156

# load the model (equivalent to ga_model_load())
decomp_ga <- ga_model_example("decomp_ga.gamr")

# apply model to your data
d1 <- ga_model(my_viewid, model = decomp_ga)

# change default date range to 20 days ago to yesterday
d2 <- ga_model(my_viewid, model = decomp_ga, 
               date_range = c("20daysAgo","yesterday"))



## End(Not run)

googleAnalyticsR documentation built on Oct. 7, 2021, 9:06 a.m.