view_group display the range/elements of each column for selected group

view_group(dat, g_vec, t_vec = NULL)

Arguments

dat

a dataframe, preferably the wide format

g_vec

grouping vector, contain column names for grouping

t_vec

target vector, contain column names for examining the range and elements.

Value

a data table with range/elements of each column

Author

Tien-Cheng Wang

Examples

view_group(iris,c("Species"),c("Sepal.Length","Petal.Length"))
#>      Species Sepal.Length Petal.Length
#> 1     setosa      4.3~5.8        1~1.9
#> 2 versicolor        4.9~7        3~5.1
#> 3  virginica      4.9~7.9      4.5~6.9
view_group(iris,c("Species"))
#>      Species Sepal.Length Sepal.Width Petal.Length Petal.Width
#> 1     setosa      4.3~5.8     2.3~4.4        1~1.9     0.1~0.6
#> 2 versicolor        4.9~7       2~3.4        3~5.1       1~1.8
#> 3  virginica      4.9~7.9     2.2~3.8      4.5~6.9     1.4~2.5