Model | R Documentation |
Create the definition of a dataset containing one or more tables. The definition includes the name and description of the dataset and the name and description of each table, attribute, and metric within the dataset.
tables
List containing lists of data.frames and corresponding table names
name
Name of the dataset
description
Description of the data set. Must be less than or equal to 250 characters
folder_id
ID of the shared folder that the dataset should be created within. If NULL, defaults to the user's My Reports folder
new()
Model$new(tables, name, description = NULL, folder_id = NULL)
get_model()
Model$get_model()
get_name()
Model$get_name()
get_description()
Model$get_description()
get_folder_id()
Model$get_folder_id()
get_tables()
Model$get_tables()
get_attributes()
Model$get_attributes()
get_metrics()
Model$get_metrics()
clone()
The objects of this class are cloneable with this method.
Model$clone(deep = FALSE)
deep
Whether to make a deep clone.
## Not run:
# Create data frames
df1 <- data.frame("id" = c(1, 2, 3, 4, 5),
"first_name" = c("Jason", "Molly", "Tina", "Jake", "Amy"),
"last_name" = c("Miller", "Jacobson", "Turner", "Milner", "Cooze"))
df2 <- data.frame("id" = c(1, 2, 3, 4, 5),
"age" = c(42, 52, 36, 24, 73),
"state" = c("VA", "NC", "WY", "CA", "CA"),
"salary" = c(50000, 100000, 75000, 85000, 250000))
# Create a list of tables containing one or more tables and their names
tables = list(list("table_name" = "employee_id",
"data_frame" = df1),
list("table_name" = "employee_data",
"data_frame" = df2))
# Generate the data model
model <- Model$new(tables=tables, name="Employees", description="Employee Analytics Data")
model_info <- model$get_model()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.