Choose max and min row

# Finish the read.delim() call

hotdogs <- read.delim("hotdogs.txt", header = F, col.names = c("type", "calories", "sodium"))

# Select the hot dog with the least calories: lily

lily <- hotdogs[which.min(hotdogs$calories), ]

# Select the observation with the most sodium: tom

tom <- hotdogs[which.max(hotdogs$sodium), ]

# Print lily and tom

lily

tom

你可能感兴趣的:(Choose max and min row)