forestgeo/fgeo.data

Ensure luquillo_stem_random_tiny has same number of rows per CensusID

maurolepore opened this issue · 1 comments

library(tidyverse)
#> -- Attaching packages -------------------------------------------- tidyverse 1.2.1 --
#> v ggplot2 2.2.1     v purrr   0.2.4
#> v tibble  1.4.2     v dplyr   0.7.4
#> v tidyr   0.8.0     v stringr 1.3.0
#> v readr   1.1.1     v forcats 0.3.0
#> -- Conflicts ----------------------------------------------- tidyverse_conflicts() --
#> x dplyr::filter() masks stats::filter()
#> x dplyr::lag()    masks stats::lag()

# Good
list(
  census1 = fgeo.data::luquillo_stem_random %>% filter(CensusID == 5),
  census2 = fgeo.data::luquillo_stem_random %>% filter(CensusID == 6)
) %>%
  map(nrow)
#> $census1
#> [1] 1324
#> 
#> $census2
#> [1] 1324

# Bad
list(
  census1 = fgeo.data::luquillo_stem_random_tiny %>% filter(CensusID == 5),
  census2 = fgeo.data::luquillo_stem_random_tiny %>% filter(CensusID == 6)
) %>%
  map(nrow)
#> $census1
#> [1] 13
#> 
#> $census2
#> [1] 9
library(tidyverse)

# Good
list(
  census1 = fgeo.data::luquillo_stem_random %>% filter(CensusID == 5),
  census2 = fgeo.data::luquillo_stem_random %>% filter(CensusID == 6)
) %>%
  map(nrow)
#> $census1
#> [1] 1320
#> 
#> $census2
#> [1] 1320

# Bad
list(
  census1 = fgeo.data::luquillo_stem_random_tiny %>% filter(CensusID == 5),
  census2 = fgeo.data::luquillo_stem_random_tiny %>% filter(CensusID == 6)
) %>%
  map(nrow)
#> $census1
#> [1] 14
#> 
#> $census2
#> [1] 14

Created on 2018-10-16 by the reprex package (v0.2.1)