map_result_values: Convert character data from stats.nba.com to statsnbaR...

Description Usage Arguments Details Value See Also

Description

Convert all columns of a data.frame using the specified mapping and type conversion function as per the internal YAML data.

Usage

1

Arguments

df

The flattened JSON data.)frame from stats.nba.com with statsnbaR attribute names.

Details

The YAML specification of the data type might look as follows:

1
2
3
4
5
6
7
data    :
    played :
        class   : logical
        mapping : {
            'Y' : TRUE,    # played
            'N' : FALSE    # never played
            }

Now any column named ‘played’ would be mapped from the character values to a logical TRUE or FALSE, and converted to the logical class (a redundant step for this example).

Value

Data.frame of converted and mapped data.

See Also

type_converters


stephematician/statsnbaR documentation built on May 30, 2019, 3:17 p.m.