[text] R

Viewer

  1. a<-c(1,2,3)
  2. b<-c(4,5,6)
  3. c<-c(7,8,9)
  4. m<-cbind(a,b,c)
  5. print("Content of the said matrix:")
  6. print(m)
  7.  
  8.  
  9. name = c('Anastasia', 'Dima', 'Katherine', 'James', 'Emily', 'Michael', 'Matthew', 'Laura', 'Kevin', 'Jonas')
  10. score = c(12.5, 9, 16.5, 12, 9, 20, 14.5, 13.5, 8, 19)
  11. attempts = c(1, 3, 2, 3, 2, 3, 1, 1, 2, 1)
  12. qualify = c('yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', 'no', 'no', 'yes')
  13. print("Original data frame:")
  14. print(name)
  15. print(score)
  16. print(attempts)
  17. print(qualify)
  18. df = data.frame(name, score, attempts, qualify)  
  19. print(df)
  20.  
  21.  
  22. list1 = list(g1 = 1:10, g2 = "R Programming", g3 = "HTML")
  23. print("Original list:")
  24. print(list1)
  25. names(list1) = c("one", "two", "three")
  26. print("Assign new names 'one', 'two' and 'three' to the elements of the said list")
  27. print(list1)
  28.  

Editor

You can edit this paste and save as new: