topepo / AmesHousing

Ames IA Housing data from De Cock (2011)
14 stars 12 forks source link

Replace rename_at() with rename_with() #6

Closed juliasilge closed 4 years ago

juliasilge commented 4 years ago

This PR fixes some internal things going on in make_ames() that results in warnings on the newer dplyr, shown here. I found this while working on tidymodels.org.

library(AmesHousing)
make_ames()
#> Warning: `funs()` is deprecated as of dplyr 0.8.0.
#> Please use a list of either functions or lambdas: 
#> 
#>   # Simple named list: 
#>   list(mean = mean, median = median)
#> 
#>   # Auto named with `tibble::lst()`: 
#>   tibble::lst(mean, median)
#> 
#>   # Using lambdas
#>   list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_warnings()` to see where this warning was generated.
#> # A tibble: 2,930 x 81
#>    MS_SubClass MS_Zoning Lot_Frontage Lot_Area Street Alley Lot_Shape
#>    <fct>       <fct>            <dbl>    <int> <fct>  <fct> <fct>    
#>  1 One_Story_… Resident…          141    31770 Pave   No_A… Slightly…
#>  2 One_Story_… Resident…           80    11622 Pave   No_A… Regular  
#>  3 One_Story_… Resident…           81    14267 Pave   No_A… Slightly…
#>  4 One_Story_… Resident…           93    11160 Pave   No_A… Regular  
#>  5 Two_Story_… Resident…           74    13830 Pave   No_A… Slightly…
#>  6 Two_Story_… Resident…           78     9978 Pave   No_A… Slightly…
#>  7 One_Story_… Resident…           41     4920 Pave   No_A… Regular  
#>  8 One_Story_… Resident…           43     5005 Pave   No_A… Slightly…
#>  9 One_Story_… Resident…           39     5389 Pave   No_A… Slightly…
#> 10 Two_Story_… Resident…           60     7500 Pave   No_A… Regular  
#> # … with 2,920 more rows, and 74 more variables: Land_Contour <fct>,
#> #   Utilities <fct>, Lot_Config <fct>, Land_Slope <fct>, Neighborhood <fct>,
#> #   Condition_1 <fct>, Condition_2 <fct>, Bldg_Type <fct>, House_Style <fct>,
#> #   Overall_Qual <fct>, Overall_Cond <fct>, Year_Built <int>,
#> #   Year_Remod_Add <int>, Roof_Style <fct>, Roof_Matl <fct>,
#> #   Exterior_1st <fct>, Exterior_2nd <fct>, Mas_Vnr_Type <fct>,
#> #   Mas_Vnr_Area <dbl>, Exter_Qual <fct>, Exter_Cond <fct>, Foundation <fct>,
#> #   Bsmt_Qual <fct>, Bsmt_Cond <fct>, Bsmt_Exposure <fct>,
#> #   BsmtFin_Type_1 <fct>, BsmtFin_SF_1 <dbl>, BsmtFin_Type_2 <fct>,
#> #   BsmtFin_SF_2 <dbl>, Bsmt_Unf_SF <dbl>, Total_Bsmt_SF <dbl>, Heating <fct>,
#> #   Heating_QC <fct>, Central_Air <fct>, Electrical <fct>, First_Flr_SF <int>,
#> #   Second_Flr_SF <int>, Low_Qual_Fin_SF <int>, Gr_Liv_Area <int>,
#> #   Bsmt_Full_Bath <dbl>, Bsmt_Half_Bath <dbl>, Full_Bath <int>,
#> #   Half_Bath <int>, Bedroom_AbvGr <int>, Kitchen_AbvGr <int>,
#> #   Kitchen_Qual <fct>, TotRms_AbvGrd <int>, Functional <fct>,
#> #   Fireplaces <int>, Fireplace_Qu <fct>, Garage_Type <fct>,
#> #   Garage_Finish <fct>, Garage_Cars <dbl>, Garage_Area <dbl>,
#> #   Garage_Qual <fct>, Garage_Cond <fct>, Paved_Drive <fct>,
#> #   Wood_Deck_SF <int>, Open_Porch_SF <int>, Enclosed_Porch <int>,
#> #   Three_season_porch <int>, Screen_Porch <int>, Pool_Area <int>,
#> #   Pool_QC <fct>, Fence <fct>, Misc_Feature <fct>, Misc_Val <int>,
#> #   Mo_Sold <int>, Year_Sold <int>, Sale_Type <fct>, Sale_Condition <fct>,
#> #   Sale_Price <int>, Longitude <dbl>, Latitude <dbl>

Created on 2020-04-07 by the reprex package (v0.3.0)

The new version does not result in any warnings. I also redocumented for the updated roxygen.