I am new to R and new to this community.
I have to deal with a lot of data at the moment and I try to make my life easier, so I want to create a pipeline, where I can upload a file and then get plots, pie charts, statistical analyses, and PCA as a result.
Within my data sets I have 8 re-ocurring specific categorical variables. Lets call them A-H. So in order to save time, I would like to assign a specific colour to a specific variable: eg. A = blue, B = white etc.
plot(sample.tsv$Annotation, col = c("blue", "white", "light blue", "green", "purple", "red", "black", "yellow"),
My function at the moment looks like the one above, which works great for the first dataset, but if in my next dataset B is not there (which might be the case) of course the colours get mixed up. Is there an easy solution I have missed? I have looked for 3 hours already and I cannot find anything, which really helped on the websides. Thank you in advance!

