I have the following CSV:
color,val2,val3
blue,1,4
green,7,3
blue,4,2
red,9,3
red,2,6
blue,1,7
I simply want to aggregate by color.
When I'm trying:
csv <- read.csv("/home/user/file.csv", stringsAsFactors=FALSE)
data <-aggregate(csv, list(csv[["color"]]), sum)
I get
Error in FUN(X[[i]], ...) : invalid 'type' (character) of argument