Description Usage Arguments Examples
this function cleans up the filters string(s) taken as input in LookerQuery
1 | filtersClean(filters = NULL)
|
filters |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (filters = NULL)
{
filter_list = strsplit(filters, split = ":")
if (length(filter_list) == 1) {
filter_list_clean <- gsub(" ", "+", paste("filters[",
filter_list[[1]][1], "]=", gsub("^[[:space:]]|[[:space:]]$",
"", filter_list[[1]])[2], sep = ""))
}
else {
filter_list_clean <- list()
for (i in 1:length(filter_list)) {
filter_list_clean[[i]] <- gsub(" ", "+", paste("filters[",
filter_list[[i]][1], "]=", gsub("^[[:space:]]|[[:space:]]$",
"", filter_list[[i]])[2], sep = ""))
}
filter_list_clean <- paste(unlist(filter_list_clean),
collapse = "&")
}
return(filter_list_clean)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.