Hi there,
I am brand new to this forum (and to R), so please let me know if you need any more information.
I have a dataset of about 45K observations of phytoplankton species in several lakes - 245 different genuses. Each sample has the Genus and the Common name - what I am trying to do is create a list of the common names for each of the 245 unique genera.
Here is an example of the dataset:
gen.com
Genera Common_Name
1 Achnanthidium
2 Aphanizomenon Blue-green Algae
3 Chlorella Green Algae
4 Chroococcus
5 Chrysochromulina
6 Crucigenia Green Algae
7 Cryptomonas Dinoflagellates
8 Cyclotella Centric Diatoms
9 Diatoma
10 Dictyosphaerium
11 Dinobryon Yellow Algae
12 Kirchneriella Green Algae
13 Mallomonas Yellow Algae
14 Monoraphidium
15 Nitzschia Pennate Diatoms
16 Ochromonas Yellow Algae
17 Plagioselmis
18 Planktolyngbya
I have tried extracting the unique genus values and then matching them against the common names, but all I get is an NA error.
gen.com <- phyto.new[c("Genera", "Common_Name")]
gen <- unique(gen.com$Genera)
match(gen,gen.com$Common_Name)
match(gen,gen.com$Common_Name)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[66] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[131] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[196] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
Does anyone know what I'm doing wrong?