mardi 27 février 2018

Removing rows from R data frame using the for loop with if statement

df <- data.frame(
 V1 = c(1,3,3,5,5,6),
 V2 = c(19,19,38,19,38,19),
 V3 = c(1,3,1,7,2,10)
)

How can I remove the rows where V2 is an odd number using the for loop with if statement?

Aucun commentaire:

Enregistrer un commentaire