Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 204922

How to convert nested list name into tibble with row names

$
0
0

I have the following nested list:

l <- list(`1` = c(Fn1 = 85.3820037423659, Sema3c = 0.0362596376899117, 
App = 8.08423415658745), `3` = c(Fn1 = 11.0051859200698, Sema3c = 0, 
App = 44.0000000000306), `4` = c(Fn1 = 3.4594316186373, Sema3c = 0, 
App = 6.54280428377643))

That looks like this:

$`1`
        Fn1      Sema3c         App 
85.38200374  0.03625964  8.08423416 

$`3`
     Fn1   Sema3c      App 
11.00519  0.00000 44.00000 

$`4`
     Fn1   Sema3c      App 
3.459432 0.000000 6.542804 

What I want to convert them into tibble.

               `1`   `3`   `4`

  Fn1      85.4     11.0  3.46
  Semac3    0.0363   0    0   
  App      8.08    44.   6.54

How can I achieve that?

I tried tibble::as_tibble(l) but it doesn't show the row name.


Viewing all articles
Browse latest Browse all 204922

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>