I came across this piece of code
...
temp <- as.data.frame(aggregate(Petal.Width~Species, iris, mean))
...
My question is: aggregate(Petal.Width~Species, iris, mean)
was already a dataframe, what was the need for as.data.frame()
then?
I came across this piece of code
...
temp <- as.data.frame(aggregate(Petal.Width~Species, iris, mean))
...
My question is: aggregate(Petal.Width~Species, iris, mean)
was already a dataframe, what was the need for as.data.frame()
then?