Description Usage Arguments Details Value See Also
This takes the data.frames returned by flatten_json_rowSet
and converts the attributes (columns) to the desired data types specified
by statsnbaR's internal YAML.
1  | map_results(df, api.mapping)
 | 
df | 
 Flattened NBA API data  | 
api.mapping | 
 The mapping from API data to statsnbaR data  | 
The column name is used to identify the correct mapping and/or type conversion function. The mappings and data types are specified in the statsnbaR internal YAML data, available at https://www.github.com/stephematician/statsnbaR/tree/master/data-raw/ADL.yaml
The YAML specification of the data type might look as follows:
1 2 3 4 5 6 7  | 
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).
The data frame with mapped values
type_converters map_result_values
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.