If I have the data frame provided below is there a way to select for the highest IDs for all the genes.
gene_name <- c("AADACL2", "AADACL3", "AADACL4", "AADACL4", "AADACL4", "AADACL4", "AADACL4", "AADACL4")
target_id <- c(79.0524, 62.0098, 61.6708, 65.1106, 58.6207, 63.9706, 64.3735, 61.3232)
table <- data.frame(gene_name = gene_name, id = target_id)
I want a dataframe that looks something like this instead:
gene_name_2 <- c("AADACL2", "AADACL3", "AADACL4")
target_id_2 <- c(79.0524, 62.0098, , 65.1106)
table_2 <- data.frame(gene_name = gene_name_2, id = target_id_2)
I have a much bigger set of data than this so need to do it for a lot of genes, I just can't work out a way to do it