Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含三列的数据框:批处理、试用、时间。
为每个批号运行五次试验 (0-4)。
我想从每个批次中取出时间最短的行并将它们放入一个新的数据框中。
我不知道从哪里开始。
假设数据帧为 df。
Try df.new <- df[ df$Time == ave(df$Time, df$Batch, FUN=min), ])