[R] how to replace values in a named vector
Ana Marija
@okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Mon Sep 14 18:35:02 CEST 2020
Hello,
I have a vector like this:
> head(geneSymbol)
Ku8QhfS0n_hIOABXuE Bx496XsFXiAlj.Eaeo W38p0ogk.wIBVRXllY
QIBkqIS9LR5DfTlTS8 BZKiEvS0eQ305U0v34 6TheVd.HiE1UF3lX6g
"MACC1" "GGACT" "A4GALT"
"NPSR1-AS1" "NPSR1-AS1" "AAAS"
it has around 15000 entries. How do I replace all values with NA
expect these that are named like this:
geneSymbol[c("0lQ1XozriVZTn.PezY","uaeFiCdegrnWFijF_s","ZOluqaxSe3ndekoNng","912ny6eCHjnlY2XSCU","odF3XHR8CVl4SAUaUQ")]
> geneSymbol[c("0lQ1XozriVZTn.PezY","uaeFiCdegrnWFijF_s","ZOluqaxSe3ndekoNng","912ny6eCHjnlY2XSCU","odF3XHR8CVl4SAUaUQ")]
0lQ1XozriVZTn.PezY uaeFiCdegrnWFijF_s ZOluqaxSe3ndekoNng
912ny6eCHjnlY2XSCU odF3XHR8CVl4SAUaUQ
"FLCN" "FLCN" "FLCN"
"UCA1" "IL1B"
Thanks
Ana
More information about the R-help
mailing list