Skip to main content
Added creation of appropriate Data Frame.
Source Link
Matthew Lundberg
  • 42.7k
  • 6
  • 93
  • 112

Try this one:

dat <- data.frame(Age=c(1,1,1,1,4,4,4),Height=c(0.5,0.6,0.7,0.6,2.0,2.3,2.3))

dat[dat$Age==4,2]

Try this one:

dat[dat$Age==4,2]

Try this one:

dat <- data.frame(Age=c(1,1,1,1,4,4,4),Height=c(0.5,0.6,0.7,0.6,2.0,2.3,2.3))

dat[dat$Age==4,2]
Source Link
Matthew Lundberg
  • 42.7k
  • 6
  • 93
  • 112

Try this one:

dat[dat$Age==4,2]