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

Consistently allow lapply and purrr functions to work on collections of crunch things #552

Open
gergness opened this issue Mar 12, 2021 · 0 comments

Comments

@gergness
Copy link
Contributor

gergness commented Mar 12, 2021

This works:

cat_names <- purrr::map(categories(ds$wave), ~name(.))

But this doesn't:

sv_names <- map(subvariables(ds$veg_enjoy_ca), ~dates(.))
#> Error: `.x` must be a vector, not a `Subvariables` object
#> Run `rlang::last_error()` to see where the error occurred.

lapply works for both of these cases, but doesn't here:

lapply(variables(cd(ds, "/")), function(x) name(x))
#>  Error: "https://app.crunch.io/api/datasets/<id>/variables/<id>/" is an invalid path: https: is not a folder 
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