Reputation:
What flower(s) had the longest petals from the year 1980-1985?
subset(Garden$Year, subset = "Year" == 1980:1985)
Upvotes: 0
Views: 38
Reputation: 886938
We may subset the 'Year' with %in%
, use the other column (not clear what the column name is - maybe 'petals') to subset and get the max
with(Garden, max(petals[Year %in% 1980:1985]))
subset
works on a data.frame and not on a vector/column
Upvotes: 1