[Help] I want to export a summary table of all of my dataset

wow it works!
This is just the thing what I have wanted!!

Thank you so much for all of your help!

> library(tibble)
> library(purrr)
> 
> DataNames <- ls()
> GetInfo <- function(x) {
+   Obj <- get(x)
+   if (is.data.frame(Obj)){
+     Name <- x
+     Obs <-  nrow(Obj)
+     Vars <- ncol(Obj)
+   } else {
+     Name <-  x
+     Obs <-  NA
+     Vars <-  NA
+   }
+   tibble(Name = Name, Observations = Obs, Variables = Vars)
+   
+ }
> TBL <- map_dfr(DataNames, GetInfo )
> TBL
# A tibble: 160 x 3
   Name                    Observations Variables
   <chr>                          <int>     <int>
 1 art_No                           946        18
 2 art_Yes                          254        18
 3 Before_sleep_music                32        18
 4 Before_sleep_nothing              44        18
 5 Before_sleep_PC                   99        18
 6 Before_sleep_smartphone          715        18
 7 Before_sleep_TV                  235        18
 8 CableTV_No                       135        18
 9 CableTV_Yes                      968        18
10 cafe_No                          794        18
# ... with 150 more rows
1 Like