bgg_namestyle: Detect the namestyle of the data table

View source: R/bgg_tools.R

bgg_namestyleR Documentation

Detect the namestyle of the data table

Description

Detects whether the dt data.table was created by a bggAPI object with 'pretty' or 'classic' names. Ends with the error if one of them cannot be unequivocally determined. This can be useful when working on a modified table that is no longer directly connected to any bggAPI object.

Usage

bgg_namestyle(dt)

Arguments

dt

a data.table from data slot of a bggAPI object.

Value

A single string.

Author(s)

Jakub Bujnowicz bujnowiczgithub@gmail.com

Examples

## Not run: 
    gm <- bggGames$new(ids = 224517)
    bgg_namestyle(gm$data)

    gm$switch_namestyle("pretty")
    bgg_namestyle(gm$data)

    # Breaks
    # bgg_namestyle(iris)

## End(Not run)


JakubBujnowicz/bggAnalytics documentation built on April 13, 2025, 7:27 a.m.