Advertisement
elena1234

Create dataframe and rename rows

Apr 6th, 2022
2,092
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.16 KB | None | 0 0
  1. Age = c(22, 25, 26)
  2. Weight = c(150, 165, 120)
  3. Sex = c('M', 'M', 'F')
  4. data = data.frame(Age, Weight, Sex)
  5.  
  6. rownames(data) <- c('Sam', 'Frank', 'Amy')
  7. print(data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement