TidierOrg / Tidier.jl

Meta-package for data analysis in Julia, modeled after the R tidyverse.
MIT License
524 stars 14 forks source link

Add `@glimpse` #89

Closed zhezhaozz closed 1 year ago

zhezhaozz commented 1 year ago

Similar to glimpse() in tidyverse, @glimpse macro is like a transposed version of print(). I also added my favorite $ in the front of each row.

For example:

julia> df = DataFrame(
               a=1:3, 
               b=1:3, 
               f_string=["7", "8","9"]
            );

julia> @chain df @glimpse
Rows: 3
Columns: 3
$ a               Int64           1, 2, 3
$ b               Int64           1, 2, 3
$ f_string        String          7, 8, 9

However, @glimpse does not support invisible return. Therefore, the following action which is supported in R is currently not supported in Julia.

@chain df begin
  glimpse() 
  select(1:3)
end
kdpsingh commented 1 year ago

Thanks! Plan to review and merge this and the other PR in the next few days.