get_structure: Extract the structure of a dataset

View source: R/get_structure.R

get_structureR Documentation

Extract the structure of a dataset

Description

This function extracts the structure and content of a data.frame, storing the following information:

Usage

get_structure(x, columns = TRUE)

Arguments

x

a data.frame to be checked

columns

the names or indices of columns to compare. Defaults to TRUE which will keep all columns by default.

Details

  • names and order of columns

  • class of the columns

  • values of the columns, for factors and characters

Value

A list containing:

  • dim: the dimensions of the dataset (rows, columns)

  • names: the names of the dataset

  • classes: the corresponding classes (if a column has several classes, only the first one is kept)

  • values: the list of sorted, unique values for each categorical column (factor or character)

Author(s)

Thibaut Jombart

Examples


head(iris)
get_structure(iris)

reconhub/linelist documentation built on Jan. 1, 2023, 9:39 p.m.