Skip to content

Commit

Permalink
Discuss the difference in precedence for the : operator between R a…
Browse files Browse the repository at this point in the history
…nd Julia. (#41681)
  • Loading branch information
CameronBieganek authored Jul 23, 2021
1 parent 4f77aba commit 073af4a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/src/manual/noteworthy-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ For users coming to Julia from R, these are some noteworthy differences:
* In Julia, a range like `a:b` is not shorthand for a vector like in R, but is a specialized `AbstractRange`
object that is used for iteration. To convert a range into a vector, use
[`collect(a:b)`](@ref).
* The `:` operator has a different precedence in R and Julia. In particular, in Julia arithmetic operators
have higher precedence than the `:` operator, whereas the reverse is true in R. For example, `1:n-1` in
Julia is equivalent to `1:(n-1)` in R.
* Julia's [`max`](@ref) and [`min`](@ref) are the equivalent of `pmax` and `pmin` respectively
in R, but both arguments need to have the same dimensions. While [`maximum`](@ref) and [`minimum`](@ref)
replace `max` and `min` in R, there are important differences.
Expand Down

2 comments on commit 073af4a

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

Please sign in to comment.