I have the two data sets below:
df <- read.table(text =
"Human_Gene_Name hsapiens mmusculus ggallus celegans dmelanogaster cintestinalis trubripes xtropicalis mmulatta
A1CF 5.634789603 4.787491743 3.688879454 2.079441542 3.931825633 2.772588722 3.871201011 3.044522438 4.094344562
AAK1 3.583518938 2.708050201 2.079441542 2.197224577 2.079441542 0.693147181 2.772588722 2.079441542 3.218875825
AAMP 3.555348061 3.17805383 2.48490665 1.791759469 2.302585093 0.693147181 2.48490665 1.098612289 2.079441542", header = T)
ctn_df <- read.table(text = "Species CTN
hsapiens 158
mmusculus 85
ggallus 67
celegans 32
dmelanogaster 27
cintestinalis 19
trubripes 110
xtropicalis 82
mmulatta 71
", header = T)
The values in 'df' represent functional diveresity, I want to work out the pearsons correlation coefficient for each gene based on the species CTNs and functional diversity.
Is there a way I can easily assign CTN to a specific species in the table 'df' based on the data from 'ctn_df'.
Sorry if this is a simple question.