search for: mysetosamodel

Displaying 1 result from an estimated 1 matches for "mysetosamodel".

2012 Dec 10
3
splitting dataset based on variable and re-combining
...and create a dataframe of just two Species, setosa and versicolor, shuffle them data(iris) iris <- iris[(iris$Species=="setosa" | iris$Species=="versicolor"),] irisindex <- sample(1:nrow(iris), nrow(iris)) iris <- iris[irisindex,] # Make predictions on setosa using the mySetosaModel model, and on versicolor using the myVersicolorModel: predict(mySetosaModel, iris[iris$Species=="setosa",]) predict(myVersicolorModel, iris[iris$Species=="versicolor",]) The problem is this will give me a vector of just the setosa results, and then one of just the versicolor r...