How can I access the n'th row of a specific column or vice-versa, if I don't know the exact index of the item | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

How can I access the n'th row of a specific column or vice-versa, if I don't know the exact index of the item

11th Aug 2022, 7:18 PM
C K
C K - avatar
1 Antwort
0
For example, to access the price of apple in this dataframe👉https://www.sololearn.com/learning/1147/4987/12808/2 you just input the index of apple form the first column. But what if the column has too many items to know the exact index? The above☝ dataframe: x <- data.frame( "product"=c("Banana", "Apple", "Orange"), "price"=c(5.99, 2.49, 3.0)) print(x$price[2]) #to get the price of an apple
11th Aug 2022, 7:25 PM
C K
C K - avatar