tablefmt

package
v0.20.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package tablefmt provides functions to create tabular data where

  1. Each variable is a column; each column is a variable.
  2. Each observation is a row; each row is an observation.
  3. Each value is a cell; each cell is a single value.

Its behavior is inspired by the R package tidyr. https://tidyr.tidyverse.org/index.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractGroupedLists

func ExtractGroupedLists[T any](data map[string]map[string]T) map[string][]string

ExtractGroupedLists transforms a map of maps into a map of strings. The keys in the nested map become a list of values.

func SwapColumns

func SwapColumns(df [][]string) [][]string

SwapColumns swaps the row values between the first and second column, if the row has a length of two.

func UnnestLongerSorted

func UnnestLongerSorted(twoColDf map[string][]string) [][]string

UnnestLongerSorted turns each element of a list-group into a row. Each key in the map represents a group and each group is associated with a list of values.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL