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

Assignments with selection? e.g. x[x > 10] <- 10 #15

Open
edwindj opened this issue May 4, 2021 · 2 comments
Open

Assignments with selection? e.g. x[x > 10] <- 10 #15

edwindj opened this issue May 4, 2021 · 2 comments
Labels

Comments

@edwindj
Copy link
Member

edwindj commented May 4, 2021

What to do with assignments with selections?

library(dcmodify)
m <- modifier(x[x > 10] <- 10)

This works, but should it be translated into

m <- modifier(if (x > 10) x <- 10)

?

@markvanderloo
Copy link
Member

We can discuss it over a second beer, after the one we used for discussing #16 👍

@edwindj
Copy link
Member Author

edwindj commented May 11, 2021

Beer it is :-),
implemented it in dcmodifydb as a post parsing step, otherwise those assignments would not work on a db.
Also in dcmodifydb is.na(x) <- x > 10 is translated into if (x > 10) x <- NA

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

No branches or pull requests

2 participants