For example, with a function that returns a data frame like aggregate
, you can do this:
aggregate(data, subset, mean)[, "row"]
And you can access the columns of the rows this way.
How would you access specific data points, without doing something like this?
df <- aggregate(data, ....)
df[df$column == max(df$column), df$row] # returns row w/ max column value
There seems to be no way to do this without having the name of the data frame to reference.
Attempting something like this doesn't seem to work:
aggregate(data, subset, mean)[aggregate(data, subset, mean)$column ==
max(aggregate(data, subset,mean), "row"]
and it's also pretty ugly code so I'd rather not even if I could.