Question: ### Note that the Code Grade virtual machine ( computer ) already has the Wine.csv file in its working directory. #### Do not submit code

### Note that the Code Grade virtual machine (computer) already has the Wine.csv file in its working directory.
#### Do not submit code with setwd() or that has a path (for example: Users/first.last/Desktop) in it.
CG Q1a # How many observations (rows) are available to you? Use the nrow() function.
CG Q1b # How many variables (columns) are collected on each rated wine? Use the ncol() function.
$#### Io is important to find the exact spellings of column names and entries within columns in the wine dataframe.
CG Q2a Use the names() or str() function on the wine dataframe to view the exact spellings of the column names. ##### You will use this strategy of "looking" in a column to get exact sepllings to answer questions on this quiz.
##### It is important to know whether there are missing values (NAs) in your data
#### since NAs need to be addressed for certain functions to work correctly.
# CG Q3a # Use the sum() and
is.na() functions to find the number of missing values in the wine dataframe.
# CG Q3b # Use the sum() and
is.na() functions to count the number of missing values in the points column.
# CG Q3C # Use the sum() and
is.na() functions to count the number of missing values in the price column.
# CG Q3d # Use the sum() and
is.na() functions to count the number of observations that have a price.
##### Hint: Since the ! means "not", putting an! in front of
is.na() counts the non-missing values.
# CG Q4a # Use the mean() function to calculate the average points for the wines in the dataset.
# CG Q4b # Use the mean() function to calculate the average price for the wines in the dataset.
# CG Q5a # Use the mean() function to calculate the average points for the Napa Sonoma sub-region.
##### Your code should be a single line and will use the square brackets for subsetting..
# CG Q6 # Now we'11 practice our counting skills again.
##### The rating scale being used by these tasters orignally had 91 as the highest possible score
##### and now goes to 100 for exceedingly delicious wines.
$$$$# Use the sum() function on a logical vector that checks for whether points are greater than 91 or not
### to count the number of wine ratings with more than 91 points.
# CG Q7a # Now we'11 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 sub-region.
# CG Q7b # 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 sub-region.
 ### Note that the Code Grade virtual machine (computer) already has

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!