Chapter 5 Homework
Introduction
Most of these exercises are taken from the textbook.
Wins and strikeouts
For this queestion you will use the Pitching
and
People
tables from the Lahman package.
Name every pitcher in baseball history who has accumulated at least
300 wins (W
) and at least 3,000 strikeouts (`SO). The table
you make should have columns for the first name, the last name, the
career wins and the career strikeouts.
SOLUTION
Home runs and batting average
For this queestion you will use the Batting
and
People
tables from the Lahman package.
Identify the name and year of every player who has hit at least 50 home runs in a single season. The table you make should have columns for the first name, last name, the number of home runs hit in the season, and the batting average that season. There should be a row for every time the player has hit at least 50 home runs. The table should be arranged in descending order of batting average.
SOLUTION
Scottish Parliament
This question uses the data tables Votes
and
Parties
from package mdsr.
When Bill S1M-29 came up for a vote, how many members of each party voted on it, either for or against? Make and display a table that shows the answer. Each row should stand for a party, and there should be two columns: one for the name of the party and the other for the number of votes cast. (Note that an abstention should not be counted as a vote.)