Advertisement
elena1234

Create dataframe and rename rows

Apr 6th, 2022
1,144
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement