Comments (1)
The use of .by_group
rather than .group_by
is not a typo. It was done by choice. To be clear, both return the same information, but in a differing arrangement.
For example, using .by_group
returns the following:
game_id week player position team offense_pct
<chr> <int> <chr> <chr> <chr> <dbl>
1 2022_01_BAL_NYJ 1 Ben Powers G BAL 1
2 2022_01_BAL_NYJ 1 Kevin Zeitler G BAL 1
3 2022_01_BAL_NYJ 1 Morgan Moses T BAL 1
4 2022_01_BAL_NYJ 1 Patrick Mekari G BAL 0.57
5 2022_01_BAL_NYJ 1 Tyler Linderbaum C BAL 1
6 2022_01_BAL_NYJ 1 Alijah Vera-Tucker G NYJ 1
7 2022_01_BAL_NYJ 1 Connor McGovern C NYJ 1
8 2022_01_BAL_NYJ 1 George Fant T NYJ 1
9 2022_01_BAL_NYJ 1 Laken Tomlinson G NYJ 1
10 2022_01_BAL_NYJ 1 Max Mitchell T NYJ 1
While using .group_by
returns the following:
game_id week player position team offense_pct
<chr> <int> <chr> <chr> <chr> <dbl>
1 2022_01_IND_HOU 1 A.J. Cann G HOU 1
2 2022_02_HOU_DEN 2 A.J. Cann G HOU 1
3 2022_03_HOU_CHI 3 A.J. Cann G HOU 1
4 2022_04_LAC_HOU 4 A.J. Cann G HOU 1
5 2022_05_HOU_JAX 5 A.J. Cann G HOU 1
6 2022_07_HOU_LV 7 A.J. Cann G HOU 1
7 2022_09_PHI_HOU 9 A.J. Cann G HOU 1
8 2022_10_HOU_NYG 10 A.J. Cann G HOU 0.94
9 2022_11_WAS_HOU 11 A.J. Cann G HOU 1
10 2022_12_HOU_MIA 12 A.J. Cann G HOU 1
Because I am interested in seeing the specific combinations of offensive linemen used by a team, per week, I opted to use .by_group
to see this, rather than group_by
which returns the information on a per-player basis.
from nfl-analytics-with-r-book.
Related Issues (16)
- Section 2.5.3 code cleanup opportunity HOT 2
- Section 3.1.1 - clear up data re. Mahomes and Manning HOT 1
- Section 3.2.0.1 - Garbage Time Metrics HOT 1
- Section 3.5.1 - update link to Joseph Jefe's website HOT 1
- Chapter 4.6 HOT 1
- Typo in 1.3 HOT 1
- 5.2.3 Typo HOT 1
- 5.3.1.1 Typo HOT 1
- 5.3.1.3 - Number of k typo HOT 1
- 5.3.2 Typo of Greere's last name HOT 1
- B2 - further reading typo HOT 1
- Tibble not sorted in descending order of avg_cpoe HOT 1
- First k-means graph data is opposite the example HOT 4
- Removing reference to "line of best fit" in initial rushing yards over expected model HOT 1
- Error in Group By HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nfl-analytics-with-r-book.