On Saturday 01 November 2003 14:26, Jonathan Baron wrote: > On 11/01/03 14:05, Martin Wegmann wrote: > >Hello, > > > >I have a df with plots (60) and their distances to bores (20) and would > > like to compute the three minimum distances to bores of each plot. > > > >with > > > >>apply(df, 2, min) > > > >I get the overall min, but is there a way to get additionally to the first > >min, the second and third minimum distance? > > Something like: > apply(df,2,sort)[1:3,] > or > apply(df,2,sort)[,1:3] > or > apply(df,1,sort)[,1:3] > or > apply(df,1,sort)[1:3,] > > I can't think through how your data are laid out, but I'm pretty > sure one of these will work.
apply(df,2,sort)[1:3,] worked for my data set thanks Berwin & Jonathan for the quick help! Martin ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
