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

gen_reljoin_table doesn't respect variables with the same name as before #37

Open
kieranjmartin opened this issue Oct 21, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@kieranjmartin
Copy link

kieranjmartin commented Oct 21, 2021

If in a relational table I generate a variable that already exists in the base data set, the original will be kept; I this is due to the behaviour of cbind.data.frame (

patdf <- cbind.data.frame(patdf, newcols)
).

Example:

DM <- tribble(
  ~USUBJID, ~DOMAIN,
  1, "DM",
  2, "DM"
)

join_fun <- rand_per_key("USUBJID","DM", mincount = 0, maxcount = 5, prop_present = 1)
AE_join_recipe <-  tribble(~foreign_tbl, ~foreign_key, ~func, ~func_args,
                           "DM", "USUBJID", "join_fun", list())

AE_recipe<- tribble(
  ~variables,       ~dependencies,      ~func,               ~func_args,
  "DOMAIN",          NULL,              rep_n,               list(val = "AE"),
  
)



AE <- gen_reljoin_table(AE_join_recipe, AE_recipe, db = list(DM = DM))
@kieranjmartin kieranjmartin added the bug Something isn't working label Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant