Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove use of "each" in arrays #501

Open
gergness opened this issue Sep 14, 2020 · 1 comment
Open

remove use of "each" in arrays #501

gergness opened this issue Sep 14, 2020 · 1 comment

Comments

@gergness
Copy link
Contributor

It's deprecated, need to be more explicit about subvariable ids

@gergness gergness changed the title remove use "each" in arrays remove use of "each" in arrays Sep 14, 2020
@gergness
Copy link
Contributor Author

Two examples:

library(crunch)

login()

ds <- loadDataset("example")

httr::with_verbose(table(ds$y_array2))
# GET /api/datasets/f49b53566ebb43c8805a7a96ff302b75/cube/?query=%7B%22dimensions%22%3A%5B%7B%22each%22%3A%22https%3A%2F%2Fapp.crunch.io%2Fapi%2Fdatasets%2Ff49b53566ebb43c8805a7a96ff302b75%2Fvariables%2F36e627b215d84731a348538f938ce674%2F%22%7D%2C%7B%22function%22%3A%22as_selected%22%2C%22args%22%3A%5B%7B%22variable%22%3A%22https%3A%2F%2Fapp.crunch.io%2Fapi%2Fdatasets%2Ff49b53566ebb43c8805a7a96ff302b75%2Fvariables%2F36e627b215d84731a348538f938ce674%2F%22%7D%5D%7D%5D%2C%22measures%22%3A%7B%22count%22%3A%7B%22function%22%3A%22cube_count%22%2C%22args%22%3A%5B%5D%7D%7D%7D&filter=%7B%7D HTTP/2
#  (URL decoded & prettified)
# {
#     "dimensions": [
#         {
#             "each": "https://app.crunch.io/api/datasets/f49b53566ebb43c8805a7a96ff302b75/variables/36e627b215d84731a348538f938ce674/"
#         },
#         {
#             "function": "as_selected",
#             "args": [
#                 {
#                     "variable": "https://app.crunch.io/api/datasets/f49b53566ebb43c8805a7a96ff302b75/variables/36e627b215d84731a348538f938ce674/"
#                 }
#             ]
#         }
#     ],
#     "measures": {
#         "count": {
#             "function": "cube_count",
#             "args": [
#                 
#             ]
#         }
#     }
# }


deck <- decks(ds)[[1]]

httr::with_verbose(newSlide(deck, ~ds$y_array2, title = "y array2"))
# {
#     "element": "shoji:entity",
#     "body": {
#         "title": "y array2",
#         "subtitle": "",
#         "analyses": [
#             {
#                 "query": {
#                     "dimensions": [
#                         {
#                             "each": "https://app.crunch.io/api/datasets/f49b53566ebb43c8805a7a96ff302b75/variables/36e627b215d84731a348538f938ce674/"
#                         },
#                         {
#                             "function": "as_selected",
#                             "args": [
#                                 {
#                                     "variable": "https://app.crunch.io/api/datasets/f49b53566ebb43c8805a7a96ff302b75/variables/36e627b215d84731a348538f938ce674/"
#                                 }
#                             ]
#                         }
#                     ],
#                     "measures": {
#                         "count": {
#                             "function": "cube_count",
#                             "args": [
#                                 
#                             ]
#                         }
#                     }
#                 },
#                 "display_settings": {
#                     "percentageDirection": {
#                         "value": "colPct"
#                     },
#                     "showEmpty": {
#                         "value": false
#                     },
#                     "showMean": {
#                         "value": false
#                     },
#                     "vizType": {
#                         "value": "table"
#                     },
#                     "countsOrPercents": {
#                         "value": "percent"
#                     },
#                     "decimalPlaces": {
#                         "value": 1
#                     },
#                     "showSignif": {
#                         "value": true
#                     },
#                     "currentTab": {
#                         "value": 0
#                     }
#                 }
#             }
#         ]
#     }
# }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant