Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 1.11 KB

File metadata and controls

28 lines (22 loc) · 1.11 KB

R exercise 2

  1. Assign the value of 3 to the variable x.
  2. Assign the value 25 to the variable y.
  3. Assign the value of x to the variable y.
  4. Before printing it out, think about what the current values of x and y.
  5. What are the values of x and y (check).
  6. Now assign assign x a new value of 10.
  7. Has the value of y changed? Why or why not?
  8. Check the value of y.
  9. What is 3452?
  10. What is the square root of 1250?
  11. Make a numeric vector a of the following numbers: 3 9 12 17 -3
  12. Make another vector b of the following numbers: 1 2 3 4 -5
  13. Make a new vector c that concatenates a and b.
  14. How would you do element by element addition of a and b?
  15. How about element by element division?
  16. What is the length of a, of b and of c?
  17. Check to see if a and b are equal.
  18. Make a vector b3 that is the vector b repeated three times in a row.
  19. Use the identical() function to check to see if all elements of a equal a and if a equals b.