- a<-c(1,2,3)
- b<-c(4,5,6)
- c<-c(7,8,9)
- m<-cbind(a,b,c)
- print("Content of the said matrix:")
- print(m)
- name = c('Anastasia', 'Dima', 'Katherine', 'James', 'Emily', 'Michael', 'Matthew', 'Laura', 'Kevin', 'Jonas')
- score = c(12.5, 9, 16.5, 12, 9, 20, 14.5, 13.5, 8, 19)
- attempts = c(1, 3, 2, 3, 2, 3, 1, 1, 2, 1)
- qualify = c('yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', 'no', 'no', 'yes')
- print("Original data frame:")
- print(name)
- print(score)
- print(attempts)
- print(qualify)
- df = data.frame(name, score, attempts, qualify)
- print(df)
- list1 = list(g1 = 1:10, g2 = "R Programming", g3 = "HTML")
- print("Original list:")
- print(list1)
- names(list1) = c("one", "two", "three")
- print("Assign new names 'one', 'two' and 'three' to the elements of the said list")
- print(list1)
[text] R
Viewer
Editor
You can edit this paste and save as new:
File Description
- R
- Paste Code
- 04 May-2024
- 793 Bytes
You can Share it: