# Conditioning

The following practice problems all deal with a data set that’s near and dear to our hearts, the Palmer penguins. Like always, let’s start our analysis by loading in the necessary packages and data sets.

Code
``````library(tidyverse)
library(stat20data)``````

For the questions below that ask you to extract a subset of the data, check your answer by using the new data frame to modify the penguins plot.

Code
``````ggplot(penguins, aes(x = bill_length_mm,
y = bill_depth_mm,
color = species)) +
geom_point() +
lims(x = c(30, 60),
y = c(12, 23))`````` #### Question 1

Extract a data frame that excludes the Adelie penguins.

#### Question 2

Extract a data frame that excludes the Adelie penguins and retains penguins with bill lengths between 40 and 50 mm. Sort it in decreasing order by bill length.

#### Question 3

Calculate the mean bill length and bill depth for each of the three species of penguins. Do those statistics line up with what you see in the penguins plot above?

#### Question 4

Consider a new metric called `bill_size` that’s the sum of the length and depth. What is the average bill size and it’s standard deviation among each species, broken out among each of the islands? (that is, nine pairs of statistics) Sort your resulting data frame in decreasing order by average bill size.
{"ft_lang_label":"__label__en","ft_lang_prob":0.87479925,"math_prob":0.96132714,"size":1093,"snap":"2023-40-2023-50","text_gpt3_token_len":240,"char_repetition_ratio":0.13865931,"word_repetition_ratio":0.04255319,"special_character_ratio":0.20311071,"punctuation_ratio":0.0754717,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9837706,"pos_list":[0,1,2],"im_url_duplicate_count":[null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-09T17:51:57Z\",\"WARC-Record-ID\":\"<urn:uuid:7f11b0d8-5a7b-44af-98dd-12c87aea1181>\",\"Content-Length\":\"30501\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9dadcd1a-27d0-43a8-a77a-5d9b7009b5b8>\",\"WARC-Concurrent-To\":\"<urn:uuid:08500045-6e21-4a4f-9386-536fa56b02bb>\",\"WARC-IP-Address\":\"44.217.161.11\",\"WARC-Target-URI\":\"https://www.stat20.org/2-summarizing-data/04-conditioning/ps.html\",\"WARC-Payload-Digest\":\"sha1:Q4UDT7RFQI6HW6EUYBONV65MDD766N7H\",\"WARC-Block-Digest\":\"sha1:K3G332CFMBQBICIOWXTMBFO2VKXMVGMP\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100942.92_warc_CC-MAIN-20231209170619-20231209200619-00888.warc.gz\"}"}