Hello, I have data on species in different state parks. There are four main columns: Region (categorical), Park (categorical), Nativeness (categorical), Organism (Categorical). The ultimate goal is to run a two way ANOVA on the dataset, but to do that I need to make the Nativeness category numeric according to park. In the end I want a number of native species for each park. I tried using
data$category <- as.numeric(data$category)
but that just turned all of the "natives" in the nativeness column into the same number rather than adding them up according to national park before turning the data into numeric.
Thanks for your help!