1

I have a data frame that is called names as follows

Name,no1,no2
john,12,14
john,23,24
tom,24,26
tom,25,27
pat,15,16
pat,16,17

What I want to do is to have 3 data frames for john, tom and pat meaning if i select john, it should display

12,14
23,24

How should I do this in R? I am currently stuck at

john <- as.data.frame(myData, column.names = Name)

as I couldn't figure out or find a way anywhere to select john as it is not considered a row name but a value inside a row.

any help is much appreciated

Heikki
  • 2,214
  • 19
  • 34
Johnson
  • 11
  • 5

0 Answers0