Challenge 1 Wildbird submission

challenge_1
wildbirds
Author

Cameron Needels

Published

February 22, 2023

Code
library(tidyverse)
library(summarytools)

knitr::opts_chunk$set(echo = TRUE, warning=FALSE, message=FALSE)

Data description

The data set consists of 2 columns, water weight in grams and the population size of wild birds. There were 146 different populations of birds studied in this data set as well.

The minimum weight is 5.5g , the median is 69.2g, and the maximum is 9639.8g.

The minimum population size was 4.9, the median was 24,353.2, and the max was 5,093,378.

The data summary shows the mean weight amongst all the birds is 363.7 grams with a standard deviation of 983.5. The mean population was 382,874 with a standard deviation of 951,938.7.

Code
#this is to make the excel file readable, i needed to skip 2 lines here in order to change the long variable names. This makes it way easier to use those parameters in the future
library(readxl)
wild_bird_data <- read_excel("B:/Needels/Documents/DACCS 601/601_Spring_2023/posts/_data/wild_bird_data.xlsx",
                            skip = 2,
                            col_names = c("weight", "pop_size"))
wild_bird_data
# A tibble: 146 × 2
   weight pop_size
    <dbl>    <dbl>
 1   5.46  532194.
 2   7.76 3165107.
 3   8.64 2592997.
 4  10.7  3524193.
 5   7.42  389806.
 6   9.12  604766.
 7   8.04  192361.
 8   8.70  250452.
 9   8.89   16997.
10   9.52     595.
# … with 136 more rows
Code
#the dimensions of the data
dim(wild_bird_data)
[1] 146   2
Code
#a way to quickly find the variable names
colnames(wild_bird_data)
[1] "weight"   "pop_size"
Code
#with the summary tools library, I can summarize the data with a single command
dfSummary(wild_bird_data)
Data Frame Summary  
wild_bird_data  
Dimensions: 146 x 2  
Duplicates: 0  

---------------------------------------------------------------------------------------------------
No   Variable    Stats / Values                  Freqs (% of Valid)    Graph   Valid      Missing  
---- ----------- ------------------------------- --------------------- ------- ---------- ---------
1    weight      Mean (sd) : 363.7 (983.5)       146 distinct values   :       146        0        
     [numeric]   min < med < max:                                      :       (100.0%)   (0.0%)   
                 5.5 < 69.2 < 9639.8                                   :                           
                 IQR (CV) : 291.2 (2.7)                                :                           
                                                                       : .                         

2    pop_size    Mean (sd) : 382874 (951938.7)   146 distinct values   :       146        0        
     [numeric]   min < med < max:                                      :       (100.0%)   (0.0%)   
                 4.9 < 24353.2 < 5093378                               :                           
                 IQR (CV) : 196693.8 (2.5)                             :                           
                                                                       : .                         
---------------------------------------------------------------------------------------------------