In R Convert list of lists into data frame based on multiple citeria -


if create list using code

metrics<-list(m1=1,m2=2,m3=3) region_mertic <- list("west"=metrics,"east"=metrics) country_metric <- list("us"=region_mertic,"uk"=region_mertic) country <- list("country"=country_metric)   

the hierarchy of list looks this:

> names(country) [1] "country" > names(country[[1]]) [1] "us" "uk" > names(country[[1]][[1]]) [1] "west" "east" > names(country[[1]][[1]][[1]]) [1] "m1" "m2" "m3" 

how can convert following data frame. in essence filter countries, region "east" , metrics "m2","m3" , values.

us  east  m2  2  east  m3  2 uk  east  m2  3 uk  east  m3  3 

this should scalable big lists containing many lists of lists.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -