2016年6月24日金曜日

Use list as associative array part 2

This one is better than the previous one.

> test2_list <- list(list("Mon","Tue","Wed","Thu","Fri","Sat","Sun"),list(1,2,3,4,5,6,7))
> for(i in test2_list[[2]]){
+   # if(match(weekdays(as.Date(ISOdate(year(Sys.Date()),1,1)),abbreviate = TRUE),test_list[[1]][i],nomatch = FALSE))
+   print(paste(">>",test2_list[[1]][i]))
+ }
[1] ">> Mon"
[1] ">> Tue"
[1] ">> Wed"
[1] ">> Thu"
[1] ">> Fri"
[1] ">> Sat"
[1] ">> Sun"

0 件のコメント: