0

I am trying to get a table with from the data in the code below. I want the table to be structured per below. I don't need "name4" column.

Column headers:

is_away, is_home, moneyline_away, moneyline_home, date_updated, Sportsbook, Team

Rows: Toronto Blue Jays, Chicago White Sox

I am attempting to do this in R. I think I probably need to create a new df, but am unsure. This is just a small portion of a larger, similarly structured, dataset.

Sportsbook     name4          name5                       value
36     5Dimes     teams        is_away                        TRUE
37     5Dimes     teams        is_home                       FALSE
38     5Dimes     teams           name           Toronto Blue Jays
41     5Dimes     teams        is_away                       FALSE
42     5Dimes     teams        is_home                        TRUE
43     5Dimes     teams           name           Chicago White Sox
45     5Dimes moneyline moneyline_away                        -126
47     5Dimes moneyline moneyline_home                         116
49     5Dimes moneyline   date_updated 2019-05-15T19:01:06.319894Z
thelatemail
  • 91,185
  • 12
  • 128
  • 188
mk12
  • 1
  • 1
  • Perhaps [this post](https://stackoverflow.com/questions/55463593/making-new-variables-for-every-group-of-observation-in-r/55465460#55465460) may help... I think you are trying to make a wide dataset by each column. – Kim May 17 '19 at 03:49
  • You might want to check out: https://stackoverflow.com/help/reprex and https://stackoverflow.com/questions/49994249/example-of-using-dput Its really hard to solve this one without example data. – MatthewR May 17 '19 at 04:55

0 Answers0