Skip to content

Commit

Permalink
Speed up prepare_bbs_ts_data'
Browse files Browse the repository at this point in the history
  • Loading branch information
diazrenata committed May 27, 2019
1 parent 3c1be4a commit ac3f45e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion R/bbs_cleaning_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@ prepare_bbs_ts_data <- function(start_yr = 1965, end_yr = 2017, min_num_yrs = 10
bbs_routes_regions_list = bbs_routes_regions_list[selected_set]
}

lapply(bbs_routes_regions_list, FUN = subset_bbs_route_region_data, bbs_data_table = bbs_data, species_table = bbs_data_tables$breed_bird_survey_species, path = path)
# lapply(bbs_routes_regions_list, FUN = subset_bbs_route_region_data, bbs_data_table = bbs_data, species_table = bbs_data_tables$breed_bird_survey_species, path = path)

for(i in 1:length(bbs_routes_regions_list)) {
this_bbs_subset = bbs_data %>%
dplyr::filter(bcr == bbs_routes_regions_list[[i]]$region,
route == bbs_routes_regions_list[[i]]$route)

subset_bbs_route_region_data(route_region = bbs_routes_regions_list[[i]], bbs_data_table = this_bbs_subset, species_table = bbs_data_tables$breed_bird_survey_species, path = path)
}

}

Expand Down
2 changes: 1 addition & 1 deletion man/build_bbs_datasets_plan.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit ac3f45e

@diazrenata
Copy link
Member Author

@diazrenata diazrenata commented on ac3f45e May 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This takes 1 minute to do 100 and ~15m to do the entire 2500.

Please sign in to comment.