You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.
# if date is usedif (is.null(date) ==FALSE) {
result<- ukp_api(
glue::glue("api/stops-street?lat={lat}&lng={lng}&date={date}")
)
# else if no date is specified
} elseif (is.null(date) ==TRUE) {
result<- ukp_api(
glue::glue("api/stops-street?lat={lat}&lng={lng}")
)
}
extract_result<-purrr::map_dfr(.x=result$content,
.f=ukp_crime_unlist)
crime:
# if date is usedif (is.null(date) ==FALSE) {
result<- ukp_api(
glue::glue("api/crimes-street/all-crime?lat={lat}&lng={lng}&date={date}")
)
# else if no date is specified
} elseif (is.null(date) ==TRUE) {
result<- ukp_api(
glue::glue("api/crimes-street/all-crime?lat={lat}&lng={lng}")
)
}
extract_result<-purrr::map_dfr(.x=result$content,
.f=ukp_crime_unlist)
The text was updated successfully, but these errors were encountered:
# if date is usedif (is.null(date) ==FALSE) {
result<- ukp_api(
glue::glue("api/crimes-street/all-crime?poly={poly_string}&date={date}")
)
# else if no date is specified
} elseif (is.null(date) ==TRUE) {
# get the latest date# last_date <- ukpolice::ukp_last_update()result<- ukp_api(
glue::glue("api/crimes-street/all-crime?poly={poly_string}")
)
Perhaps part 1 can be broken up into functions like so
# this inserts e.g. "stops-street" or "crimes-street/all-crime"# depending upon input being "stop-street"api_add_type<-function(type){
switch()
}
# add the type of callapi_type<- api_add_type(type)
# add lat longif (!missing(lat) &&!missing(long)){
api_type<- api_add_lat_long(api_type, lat, long)
}
# add poly stringif (!missing(poly)){
api_type<- api_add_poly(api_type, poly)
}
# add dateif (!is.null(date)) {
api_type<- api_add_date(api_type, date)
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
They are both very similar:
stop_search:
crime:
The text was updated successfully, but these errors were encountered: