Hello
I carried out cluster analyzes on stations and species, and now I would like to represent my stations on a map in order to visualize the distribution of the different clusters.
I manage to do everything I want except assigning colors to clusters.
The "ZooK.asin.sqrt....K..6" column is the column that associates the cluster number with my stations.
The only color I manage to get with this code is a blue gradient so very inefficient to distinguish well
I tried with scale_fill_manual but it doesn't work...
I would make a new column that is the character version of "ZooK.asin.sqrt....K..6". ggplot will then detect the discrete nature of the values and use discrete colors instead of a color gradient.
If you data frame is named DF,
I t is not possible to remove a row from just one column. Every column in a data frame must have the same number of rows. It is surprising that any row would have an NA value. Isn't every observation assigned to a cluster?
Can you explain more about why you want to remove the rows with NA?
Indeed you do not have all the elements, sorry about that.
So, I have multiple columns with cluster numbers depending on if I have K=6 (our example) or K=10, etc.
But my columns also differ with respect to zooplankton or fish. And my problem is for my fish columns because they are not present at all stations so there is no data in some rows.
My columns with ZooK, all the lines are filled because the zooK is present in all the stations, on the other hand for the fish some stations are NA because no fish.
And I want to remove the rows with NA because after I want to plot my stations on a map and I don't want to have the stations where there is no fish
But I don't want to remove these rows from the original df because I'll need its to plot my zooK map..
I can't be much help with this. I have done very little plotting of maps. I could start guessing from my general knowledge of plotting in R but that might be a waste of your time. I suggest you start a new thread for this question. People are more likely to look at new thread as opposed to threads that are already marked as solved.