I have dataset (b.data) containing information on marine species recorded in a survey. Each row relates to an individual animal with the column headings below:
"Area" "Year" "Cruise" "Vessel" "Haul" "Haul_ID" "Common_name" "Scientific_Name" "Length_mm" "Sex" "Width"
I want to subset the data to only include certain species for analysis. I have written the code below naming the species I want to include (31 species)
species.list <- c("Blonde ray","Brown crab","Cod","Common dab", ... etc
I don't know how to write the code to then subset these rows from the whole dataset. I have tried the code below but it returns 0 observations.
z=b.data[rownames(b.data$Common_name) %in% species.list,]
z <- b.data[ b.data$Common_name %in% species.list, ]- zx8754