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

confirm_overlap and pull() #1

Open
astraetech opened this issue Aug 26, 2022 · 2 comments
Open

confirm_overlap and pull() #1

astraetech opened this issue Aug 26, 2022 · 2 comments

Comments

@astraetech
Copy link

Hi,

I was wondering if I can use dplyr operators in the confirm_overlap and finish them with pull()? Something like:
confirm_overlap(top1000_hist_1_2_1_ret %>% filter(any(p_growth_shock_scaled_sum_msa_yr !=0)) %>% distinct(fhfa_msa_code) %>% pull(), tn_msa_100_hpi_curr_gdp_1_1$tn_msa_fhfa_msa_code)

It works with simple queries for mtcars but for other queries using more complex datasets like the one above confirm_overlap shows this error:
Error in splice():
! The LHS of := must be a string or a symbol
Run rlang::last_error() to see where the error occurred.

I opened the function but quickly got lost. If you could shed any light, it would be great! Thank you!

@Harrison4192
Copy link
Owner

Hi,

My recommendation for complex queries is simply to perform them outside and save the result to a variable, then put the variable into confirm_overlap. The confirm_overlap function captures the names of the inputs with enexpr and uses them to give names to the output. A complicated pipeline won't be able to be parsed as a name, and will throw an error. I've only manually included a workaround for using the "$" operator on data frames directly inside confirm_overlap.

@astraetech
Copy link
Author

Understood, thank you!

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

2 participants