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

Question regarding fcase #4593

Closed
statquant opened this issue Jul 4, 2020 · 1 comment
Closed

Question regarding fcase #4593

statquant opened this issue Jul 4, 2020 · 1 comment

Comments

@statquant
Copy link

Hello, I have a question regarding fcase, I understand that I can use it like

x = c(1,2,3,4)
fcase(x > 2, pmin(x, 3), default = 10)
[1] 10 10  3  3

But most of the time what I really would like is a vector default

x = c(1,2,3,4)
fcase(x > 2, pmin(x, 3), default = x)
[1] 10 10  3  4

the above does not work.
I am thinking about things like
fcase(x > y, x*y, default = x/y)

I guess I must be missing something here, maybe the intended use is not to do what I expect, can someone enlight me ?
Many thanks

@MichaelChirico
Copy link
Member

Thanks for the issue, I believe it's the same as here:

#4258

Please re-open if I missed something

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

No branches or pull requests

2 participants