| Title: | R Programming: Zero to Pro |
|---|---|
| Description: | This is a companion package of the book "R Programming: Zero to Pro" <https://r02pro.github.io/>. It contains the datasets used in the book and provides interactive exercises corresponding to the book. It covers a wide range of topics including visualization, data transformation, tidying data, data input and output. |
| Authors: | Yang Feng [aut, cre], Jianan Zhu [aut] |
| Maintainer: | Yang Feng <[email protected]> |
| License: | GPL-2 |
| Version: | 0.2.1 |
| Built: | 2026-10-02 12:57:57 UTC |
| Source: | https://github.com/yangfengstat/r02pro |
A dataset of 2048 houses in Ames, Iowa from 2006 to 2010, with 56 features including the sale date and price.
ahpahp
A data frame with variables:
Date Sold
Year Sold
Month Sold
Original construction date
Remodel date (same as construction date if no remodeling or additions)
The building class
1-STORY 1946 & NEWER ALL STYLES
1-STORY 1945 & OLDER
1-STORY W/FINISHED ATTIC ALL AGES
1-1/2 STORY - UNFINISHED ALL AGES
1-1/2 STORY FINISHED ALL AGES
2-STORY 1946 & NEWER
2-STORY 1945 & OLDER
2-1/2 STORY ALL AGES
SPLIT OR MULTI-LEVEL
SPLIT FOYER
DUPLEX - ALL STYLES AND AGES
1-STORY PUD (Planned Unit Development) - 1946 & NEWER
1-1/2 STORY PUD - ALL AGES
2-STORY PUD - 1946 & NEWER
PUD - MULTILEVEL - INCL SPLIT LEV/FOYER
2 FAMILY CONVERSION - ALL STYLES AND AGES
Type of dwelling
Single-family Detached
Two-family Conversion; originally built as one-family dwelling
Duplex
Townhouse End Unit
Townhouse Inside Unit
Style of dwelling
One story
One and one-half story: 2nd level finished
One and one-half story: 2nd level unfinished
Two story
Two and one-half story: 2nd level finished
Two and one-half story: 2nd level unfinished
Split Foyer
Split Level
Identifies the general zoning classification of the sale
Agriculture
Commercial
Floating Village Residential
Industrial
Residential High Density
Residential Low Density
Residential Low Density Park
Residential Medium Density
Physical locations within Ames city limits
Bloomington Heights
Bluestem
Briardale
Brookside
Clear Creek
College Creek
Crawford
Edwards
Gilbert
Iowa DOT and Rail Road
Meadow Village
Mitchell
North Ames
Northridge
Northpark Villa
Northridge Heights
Northwest Ames
Old Town
South & West of Iowa State University
Sawyer
SawyerW
Somerset
Stone Brook
Timberland
Veenker
Overall condition rating
Very Excellent
Excellent
Very Good
Good
Above Average
Average
Below Average
Fair
Poor
Very Poor
Overall material and finish quality
Very Excellent
Excellent
Very Good
Good
Above Average
Average
Below Average
Fair
Poor
Very Poor
Home functionality rating
Typical Functionality
Minor Deductions 1
Minor Deductions 2
Moderate Deductions
Major Deductions 1
Major Deductions 2
Severely Damaged
Salvage only
living area square feet
First Floor square feet
Second floor square feet
Total rooms
Number of bedrooms
Number of bathrooms
Number of kitchens
Kitchen quality
Central air conditioning
No
Yes
Electrical system
Standard Circuit Breakers & Romex
Fuse Box over 60 AMP and all Romex wiring (Average)
60 AMP Fuse Box and mostly Romex wiring (Fair)
60 AMP Fuse Box and mostly knob & tube wiring (poor)
Mixed
Total square feet of basement area
General condition of the basement
Walkout or garden level basement walls
Good Exposure
Average Exposure (split levels or foyers typically score average or above)
Mimimum Exposure
No Exposure
No Basement
Height of the basement
100+ inches
90-99 inches
80-89 inches
70-79 inches
<70 inches
No Basement
Quality of basement finished area
Good Living Quarters
Average Living Quarters
Below Average Living Quarters
Average Rec Room
Low Quality
Unfinshed
No Basement
Present condition of the material on the exterior
Exterior covering on house
Asbestos Shingles
Asphalt Shingles
Brick Common
Brick Face
Cinder Block
Cement Board
Hard Board
Imitation Stucco
Metal Siding
Other
Plywood
PreCast
Stone
Stucco
Vinyl Siding
Wood Siding
Wood Shingles
Exterior material quality
Type of foundation
Brick & Tile
Cinder Block
Poured Contrete
Slab
Stone
Wood
Fence quality
Good Privacy
Minimum Privacy
Good Wood
Minimum Wood/Wire
No Fence
Number of fireplaces
Fireplace quality
Size of garage in square feet
Size of garage in car capacity
Garage condition
Interior finish of the garage
Finished
Rough Finished
Unfinished
No Garage
Garage quality
Garage location
More than one type of garage
Attached to home
Basement Garage
Built-In (Garage part of house - typically has room above garage)
Car Port
Detached from home
No Garage
Year garage was built
Heating quality and condition
Flatness of the property
Near Flat/Level
Banked - Quick and significant rise from street grade to building
Hillside - Significant slope from side to side
Depression
Slope of property
Gentle slope
Moderate Slope
Severe Slope
Lot size in square feet
Lot configuration
Inside lot
Corner lot
Cul-de-sac
Frontage on 2 sides of property
Frontage on 3 sides of property
Linear feet of street connected to property
General shape of lot
Regular
Slightly irregular
Moderately Irregular
Irregular
Paved driveway
Paved
Partial Pavement
Dirt/Gravel
Roof material
Clay or Tile
Standard (Composite) Shingle
Membrane
Metal
Roll
Gravel & Tar
Wood Shakes
Wood Shingles
Type of roof
Flat
Gable
Gabrel (Barn)
Hip
Mansard
Shed
Open porch area in square feet
Enclosed porch area in square feet
Wood deck area in square feet
The property's sale price in thousand dollars
The original data comes from https://www.kaggle.com/c/house-prices-advanced-regression-techniques. Some data cleaning were applied.
A dataset of 239 countries worldwide with 33 sociodemographic and public health features, some of which are the same variable but measured in dichotomized genders.
gmgm
A data frame with variables:
Country
Year of the observation (1799 to 2099, later years are projections)
Percentage of female (over age 15) that smoke
Percentage of male (over age 15) that smoke
Number of new female cases of lung cancer in 100,000 residents, adjusting each country's age composition to the world population. Unit: person per 100,000 people
Number of new male cases of lung cancer in 100,000 residents, adjusting each country's age composition to the world population. Unit: person per 100,000 people
OWID Education Index: Education index calculated based on Avg years of schooling, taking values 0 as minimum and 15 as maximum.
Calories measures the energy content of the food. The required intake varies, but it is normally in the range of 1500-3000 kilocalories per day. Unit: kilocalories per person and day
This is the average daily household per capita income or consumption expenditure from the survey expressed in 2011 PPP. Unit: international dollars per person per day (2011 PPP)
The percentage of people using at least basic sanitation services, that is, improved sanitation facilities that are not shared with other households.
Death of children under five years of age per 1,000 live births. Unit: per 1000 live births
Gross domestic product per person adjusted for differences in purchasing power (in international $, fixed 2017 prices, PPP based on 2017 ICP). Unit: international dollars per person per year (2017 PPP)
Human Development Index. An index used to rank countries by the level of "human development" from three dimensions: health level, educational level, and living standard.
Total alcohol consumption per capita, male, liters of pure alcohol, 15+ years of age.
Total alcohol consumption per capita, female, liters of pure alcohol, 15+ years of age.
Number of new male cases of liver cancer in 100,000 residents, adjusting each country's age composition to the world population. Unit: person per 100,000 people.
Number of new female cases of liver cancer in 100,000 residents, adjusting each country's age composition to the world population. Unit: person per 100,000 people.
Mortality rate, adult, male (per 1,000 male adults).
Mortality rate, adult, female (per 1,000 female adults).
The mean TC (Total Cholesterol) of the male population, counted in mmol per L.
The mean TC (Total Cholesterol) of the female population, counted in mmol per L.
The continent that a country is part of
Africa
Americas
Asia
Europe
Oceania
Sub specification of the region that a country belongs to
Total population of each country in the given year. Unit: 1,000 people
The average number of years a newborn child would live if current mortality patterns were to stay the same. Unit: year
The quantity of food consumption of sugar and sweeteners per person. Unit: grams per person and day
The mean BMI (Body Mass Index) of the female population; this mean is calculated as if each country has the same age composition as the world population. Unit: Kilogram per square meter
Group according to BMI_female
under_weight: < 18.5
normal_weight: 18.5 - 24.9
pre_obesity: 25.0 - 29.9
obesity_class_I: 30.0 - 34.9
obesity_class_II: 35.0 - 39.9
The mean BMI (Body Mass Index) of the male population; this mean is calculated as if each country has the same age composition as the world population. Unit: Kilogram per square meter
Group according to BMI_male
under_weight: < 18.5
normal_weight: 18.5 - 24.9
pre_obesity: 25.0 - 29.9
obesity_class_I: 30.0 - 34.9
obesity_class_II: 35.0 - 39.9
The sum of public and private health expenditure as a percentage of GDP. Unit: percent
Inflation-adjusted gross domestic product divided by midyear population. GDP is the sum of gross value added by all resident producers in the economy plus any product taxes and minus any subsidies not included in the value of the products. It is calculated without making deductions for depreciation of fabricated assets or for depletion and degradation of natural resources. Unit: $1,000
Human Development Index categories
Very high: HDI above 0.800
High: HDI between 0.700 and 0.799
Medium: HDI between 0.550 and 0.699
Low: HDI below 0.549
The original data comes from https://www.gapminder.org/data/. Some data cleaning was applied.
A dataset of 236 countries worldwide with 23 sociodemographic and public health features, some of which are the same variable but measured in dichotomized genders.
gm2004gm2004
A data frame with variables:
Country
the year of 2004
Gender
The continent that a country is part of
Africa
Americas
Asia
Europe
Oceania
Sub specification of region that a contry belongs to
Total population of each country in 2004. Unit: 1,000 people
The mean BMI (Body Mass Index) of the whole population; this mean is calculated as if each country has the same age composition as the world population. Unit: Kilogram per square meter
Number of new cases of liver cancer in 100,000 residents in 2004, adjusting each country's age composition to the world population. Unit: person per 100,000 people
Number of new cases of lung cancer in 100,000 residents in 2004, adjusting each country's age composition to the world population. Unit: person per 100,000 people
Mean TC (Total Cholesterol) of the whole population, adjusting each country's age composition to the world population. Unit: mmol/L (Millimoles per liter)
The average number of years a newborn child would live if current mortality patterns were to stay the same. Unit: year
The quantity of good consumption of sugar and sweeteners per person. Unit: grams per person and day
The sum of public and private health expenditure as a percentage of GDP. Unit: percent
Inflation-adjusted gross domestic product divided by midyear population. GDP is the sum of gross value added by all residents producers in the economy plus any product taxes and minus any subsidies not included in the value of the products. It is calculated without making deductions for depreciation of fabricated assets or for depletion and degredation of natural resources. Unit: $1,000
Human Development Index. An index used to rank countries by level of "human development" from three dimensions: health level, educational level, and living standard.
Human Development Index categories
HDI above 0.800
HDI between 0.700 and 0.799
HDI between 0.550 and 0.699
HDI below 0.549
Percentage of both men and women (over age 15) that smoke
Caloreis measures the energy content of the food. The required intake varies, but it is normally in the range of 1500- 3000 kilocalories per day. Unit: kilocalories per person and day
OWID Education Index: Education index calculated based on Avg years of schooling, taking values 0 as minimum and 15 as maximum.
This is the average daily household per capita income or consumption expenditure from the survey expressed in 2011 PPP. Unit: international dollars per person per day (2011 PPP)
Gross domestic product per person adjusted for differences in purchasing power (in international $, fixed 2017 prices, PPP based on 2017 ICP). Unit: international dollars per person per year (2017 PPP)
The percentage of people using at least basic sanitation services, that is, improved sanitation faciliteis that are not hsared with other households.
Death of children under five years of age per 1,000 live births. Unit: per 1000 live births
The original data comes from https://www.gapminder.org/data/. Some data cleaning were applied.
This function provides interactive exercises for each lesson corresponding to each subsection of the book "R Programming: Zero to Pro"
r02pro(id)r02pro(id)
id |
the index of the lesson |
This function is an interactive exercise. Hence, no value returned.
#Do the exercise for Section 1.1 ## Not run: r02pro(1.1)#Do the exercise for Section 1.1 ## Not run: r02pro(1.1)
The small version of Ames Housing Price data of 165 observations, with 12 features including the sale date and price.
sahpsahp
A data frame with 165 observations and 12 features:
Date Sold
Number of bedrooms
Number of bathrooms
Size of garage in car capacity
Overall material and finish quality
Very Excellent
Excellent
Very Good
Good
Above Average
Average
Below Average
Fair
Poor
Very Poor
living area square feet
Lot size in square feet
Style of dwelling
One story
One and one-half story: 2nd level finished
One and one-half story: 2nd level unfinished
Two story
Two and one-half story: 2nd level finished
Two and one-half story: 2nd level unfinished
Split Foyer
Split Level
Kitchen quality
Heating quality and condition
Central air conditioning
No
Yes
The property's sale price in thousand dollars
The original data comes from https://www.kaggle.com/c/house-prices-advanced-regression-techniques. Some data cleaning were applied.