Question: # ( G Q 3 b # Use the sum ( ) and is . na ( ) functions to count the number of missing
# G Qb # Use the sum and
isna functions to count the number of missing values in the
points column.
sum
isnawine$points
# G QC # Use the sum and
isna functions to count the number of missing values in the
price column.
sum
isnawine$price
# G Qd # Use the sum and
isna functions to count the number of observations that have a price.
###### Hint: Since the means "not", putting an in front of
isna counts the nonmissing values.
sum
isnawine$price
# G Qa # Use the mean function to calculate the average points for the wines in the dataset.
meanwine$points
# CG Qb # Use the mean function to calculate the average price for the wines in the dataset. mean wine$price, narmT
# G Qa # Use the mean function to calculate the querage points for the Napa Sonoma subregion.
###### Your code should be a single line and will use the square brackets for subsetting.. meanwine$points wine$region"NapaSonoma"
# G Qb # Use the mean function to calculate the average price for the Napa Sonoma subregionusing a single line of code.
meanwine$pricewine$region"NapaSonoma"
# CG Q # Now we'll practice our counting skills again.
##### The rating scale being used by these tasters orignally had as the highest possible score
##### and now goes to for exceedingly delicious wines.
##### Use the sum function on a logical vector that checks for whether points are greater than or not
##### to count the number of wine ratings with more than points.
sumwine$points
# CG Qa # Now we'll practice subsetting on more than one criteria.
###### Use the mean function to compute the average points for wines
###### that are chardonnay and from the Napa Sonoma subregion.
meanwine$points wine$Sonoma&wine$variety"chardonnay" narmT
# CG Qb # More practice subsetting on more than one criteria.
###### Use the mean function to compute the average price for wines that are ###### either chardonnay or are from the finger lakes subregion. mean
# CG Q # Use the median function to find the median price for
##### a Cabernet Sauvignon that is rated higher than points.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
