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

%>% not working with multiplicate or divide #32

Closed
dorianps opened this issue Mar 21, 2015 · 3 comments
Closed

%>% not working with multiplicate or divide #32

dorianps opened this issue Mar 21, 2015 · 3 comments

Comments

@dorianps
Copy link
Collaborator

works with + or -
temp = ConAvgDiff.t1[[k]] %>% iMath('Normalize') %>% - brainmask

doesn't work with * and /
temp = ConAvgDiff.t1[[k]] %>% iMath('Normalize') %>% * brainmask
Error: unexpected '*' in "temp = ConAvgDiff.t1[[k]] %>% iMath('Normalize') %>% *"

@dorianps
Copy link
Collaborator Author

Never mind,
Subtraction/addition needs %>% before.
Division/multiplication works without %>%.

A bit confusing but at least works.

@bkandel bkandel closed this as completed Mar 22, 2015
@bkandel
Copy link
Collaborator

bkandel commented Mar 22, 2015

I'm not sure what you mean, but concatenating multiple atomic arithmetic
operators works just like in normal math:

r16 <- antsImageRead(getANTsRData('r16'))
mysum <- r16 + r16 + r16
mydiv <- r16 / r16 / r16
works as expected, with no need for special piping ("%>%").

2015-03-21 18:24 GMT-04:00 dorianps notifications@github.com:

Never mind,
Subtraction/addition needs %>% before.
Division/multiplication works without %>%.

A bit confusing but at least works.


Reply to this email directly or view it on GitHub
#32 (comment).

@bkandel
Copy link
Collaborator

bkandel commented Mar 22, 2015

I would use parentheses to make sure you're getting what you think you're
getting.

2015-03-21 21:10 GMT-04:00 Ben Kandel ben.kandel@sbcglobal.net:

I'm not sure what you mean, but concatenating multiple atomic arithmetic
operators works just like in normal math:

r16 <- antsImageRead(getANTsRData('r16'))
mysum <- r16 + r16 + r16
mydiv <- r16 / r16 / r16
works as expected, with no need for special piping ("%>%").

2015-03-21 18:24 GMT-04:00 dorianps notifications@github.com:

Never mind,

Subtraction/addition needs %>% before.
Division/multiplication works without %>%.

A bit confusing but at least works.


Reply to this email directly or view it on GitHub
#32 (comment).

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