AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Download the new for mac R-Studio 9.2.19116112/23/2023 What happens if you try to take the square root of -81? Use the abs() function to make it non- negative first. > sqrt(81) 9 The square root of 81 is 9! 2. When in doubt always include even more parentheses than you think you might need it’ll save you trouble later. TRUE OR FALSE? (4 is greater than or equal to 22) AND (1 is less than -1 times -1) > (4 >= 22) & (1 < (-1)*(-1)) FALSE Notice how I used parentheses to make sure that R got the order of operations right. If we’d tried it with a single = we would have gotten an error because it uses a single equal to assign a variable and we do not want that! > 5^2= Error in 5^2 = 81 : invalid (do_set) left-hand side to assignment 5. Note by the way that we had to use the double equal sign: =. TRUE OR FALSE? 52 is equal to 81? > 5^2= FALSE Yep, 5 2 is not equal to 81. TRUE or FALSE? eight is less than six > 8 < 6 FALSE Eight is not less than six!! 4. How is that different from 8+412? > (8+4)* 144 > 8+4* 56 These are different because the parentheses mean the order of operations is different. Use R to figure out how many kilometres 5 miles are. Week 1 RHMI Exercise Answers Andrew Perfors Day 2 Operators 1.
0 Comments
Read More
Leave a Reply. |