R Markdown

Below is Assignment 3a, and the comments attached for what the code is doing!

#Assignment 3a
library(readr)
fed_stimulus <- read_csv("Federal_Stimulus_Data.csv")
## Rows: 13553 Columns: 37
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (34): Project Name, Project Description, Funding Category, Funding Sourc...
## dbl  (2): Stimulus Tracker ID, Payment Id
## num  (1): Payment Value
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#Finding the Mean by using the framework in earlier lesson. 
print(paste("The mean payment is: ", mean(fed_stimulus$'Payment Value', na.rm=TRUE)))
## [1] "The mean payment is:  242044.52007382"
#Finding the Sum by using the framework in earlier lesson. 
print(paste("The sum payment is: ", sum(fed_stimulus$'Payment Value', na.rm=TRUE)))
## [1] "The sum payment is:  3180464993.77"
#Created subset 
fed_subset <- subset(fed_stimulus,`Project Status` == "Completed 50% or more") 
fed_subset
## # A tibble: 4,908 × 37
##    `Project Name` `Project Description` `Stimulus Tracker ID` `Funding Category`
##    <chr>          <chr>                                 <dbl> <chr>             
##  1 830 Amsterdam… Rooftop water tank                   109062 Infrastructure    
##  2 CUNY pilot pr… Partnership with CUN…                301006 Economic and Work…
##  3 CUNY pilot pr… Partnership with CUN…                301006 Economic and Work…
##  4 Whitman-Inger… Apartment Upgrades                   109012 Infrastructure    
##  5 Highbridge Ga… Brick & Roof.                        109036 Infrastructure    
##  6 CUNY pilot pr… Partnership with CUN…                301006 Economic and Work…
##  7 Livonia Terra… Finance the construc…                704003 Neighborhood Stab…
##  8 Interior Comp… Interior Compactors                  109071 Infrastructure    
##  9 FDNY Emergenc… An intensive 12 week…                301009 Economic and Work…
## 10 Adoption Assi… Provide additional f…                406001 Health and Social…
## # ℹ 4,898 more rows
## # ℹ 33 more variables: `Funding Source` <chr>, `Stimulus Funding` <chr>,
## #   `Displaced City Funding` <chr>, `All Other Funding` <chr>,
## #   `Award Lead City Agency` <chr>, `Project Lead City Agency` <chr>,
## #   `Project Status` <chr>, `% of Funds Spent` <chr>,
## #   `Date Funds Awarded by Fed/State` <chr>,
## #   `Date Funds Announced by NYC` <chr>, `Estimated Start Date` <chr>, …