I am trying to create a dataframe from an existing dataframe, retaining only specific columns, for a specified column value (a species in my data). Essentially I intend on creating separate dataframes for each species in my dataset, detailing the stations they were landed at, and retaining the raising agent for the hauls (RF.haul).
My reprex is
QSC <- with(Dataframe[Dataframe$Species=="QSC", ], aggregate(number=RF.haul), by(Station=Station), FUN = sum, na.rm= TRUE)
I get various errors, mostly "object not found" RE the column headings in the code, and I'm sure this is a relatively easy thing to do in R - I just can't get my head around it (I'm new to R!)