Learn R Programming

bggAnalytics (version 0.2.1)

bgg_namestyle: 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)

Value

A single string.

Arguments

dt

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

Author

Jakub Bujnowicz bujnowiczgithub@gmail.com

Examples

Run this code
gm <- bggGames$new(ids = 167791)
bgg_namestyle(gm$data)

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

# Breaks
# bgg_namestyle(iris)

Run the code above in your browser using DataLab