The question is: Split the rows of clean_mlb into a training set consisting of 29 rows for the non- Pittsburgh teams and a testing set of one observation corresponding to the Pittsburgh Pirates. Save these dataframes as train set and test set.
clean_mlb is a dataframe that was made from a data set called mlb
This is my code:
if(mlb$TM[i] == "PIT"){
}else{
}
}
I wasn't sure what to put after the if or else or if this is even what I'm supposed to be doing.