What is this code: `+`(1, `*`(2, 3))
supposed to be doing in R? Can it be coded in a more typical way? How?
A really great resource is a book called Competitive Programming 3 the book is great overall, and most importantly the Math chapter in it. The authors have really gathered a lot of Math-related problems and if you solve just a few you will definitely improve your Math and Problem Solving skills.
Being good at math is important for certain types of programming, like designing games and inventing complex algorithms. But for many other types of programming, such as developing business or web applications, you can become a successful programmer without having to study advanced math.
1. Generally is used to advice that an error ocurred in a function.
Coding is associated with math and engineering; college-level programming courses tend to require advanced math to enroll and they tend to be taught in computer science and engineering departments.
If you use operators with quotes (e.g. `+`
or `*`
), you are actually using the standard operators with the typical function
syntax.
Let's say you want to calculate 1 + 2
using that way. You could do it this way:
`+`(1, 2) ## Please call the sum operator using 1 and 2 as arguments.
So, since the expression you have posted is `+`(1, `*`(2, 3))
, it's basically the sum operator, for which the arguments are 1
and the result of the product operator, for which the arguments are 2
and 3
.
Eventually, a typical way to do this is 1 + (2 * 3)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With