Hi all,
I am having a trouble using R. I want to make a function for converting IDs between two ID formats using R.
From the file (below),
"idConverion.txt"
gene_name gene_id
AB ENSG001
ABC ENSG002
WER ENSG0052
and the function I defined below,
geneConv <- function(input, output) {
df <- fread("idConversion.txt")
input <- df$gene_name
output <- df$gene_id
return(output)
}
I want to get this result.
geneConv("AB")
"ENSG001"
But with this function, I could only get all of the IDs of column B. Could someone help me with this?