简体   繁体   中英

change labels in a list

I created a list:

aka3 = list(ID = c(AAtr="white", Anox24h="ivory4", Anox48h="goldenrod3", Anox24hATF='red'))

I am trying to change label the ID:

aka3$ID<- c( labels=c(AAtr="AA tr", Anox24h="Anox 24h", Anox48h="Anox48h", Anox24hATF="Anox 24h ATF"))

Labels could be changed when list is created or after, either way would be OK.

Here's how to create the list with the right labels:

aka3 = list(ID = c("AA tr"="white", "Anox 24h"="ivory4", "Anox 48h"="goldenrod3", 
"Anox 24h ATF"='red'))

> aka3
$ID
       AA tr     Anox 24h     Anox 48h Anox 24h ATF 
     "white"     "ivory4" "goldenrod3"        "red" 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM