1

I have the following datafram:

         ï..Employee_Name       PositionID              Position State  Zip
  1:   Adinolfi, Wilson  K         19  Production Technician I    MA 1960
  2: Ait Sidi, Karthikeyan         27                  Sr. DBA    MA 2148
  3:     Akinkuolie, Sarah         20 Production Technician II    MA 1810
  4:          Alagbe,Trina         19  Production Technician I    MA 1886
  5:       Anderson, Carol         19  Production Technician I    MA 2169
 ---                                                                     
307:        Woodson, Jason         20 Production Technician II    MA 1810
308:     Ybarra, Catherine         19  Production Technician I    MA 2458
309:      Zamora, Jennifer          6                      CIO    MA 2067
310:           Zhou, Julia          9             Data Analyst    MA 2148
311:         Zima, Colleen         19  Production Technician I    MA 1730

I have it stored in the object HRdata. I use a map function to run the table function over each of its variables:

HRtables <- map(tibble(HRdata), ~as.data.frame(sort(table(.x), decreasing = T))) 

I would like to know if there is a way to extract each list element and store it in different objects. I believe there is but I don't know how to ask the proper questions on google to get the answer. Something along the lines of:

c(a,b,c,d,e) <- HRtables
Taren Shaw
  • 89
  • 6

1 Answers1

1
list2env(setNames(HRtables, c("a", "b", "c", "d", "e")), .GlobalEnv)

Answer given by Onyambu

Taren Shaw
  • 89
  • 6