Running examples in 'cyclestreets-Ex.R' failed
The error most likely occurred in:

> ### Name: json2sf_cs
> ### Title: Convert output from CycleStreets.net into sf object
> ### Aliases: json2sf_cs
> 
> ### ** Examples
> 
> from = "Leeds Rail Station"
> to = "University of Leeds"
> # from_point = tmaptools::geocode_OSM(from)
> # to_point = tmaptools::geocode_OSM(to)
> from_point = c(-1.54408, 53.79360)
> to_point =   c(-1.54802, 53.79618)
> # save result from the API call to journey.json
> # res_json = journey(from_point, to_point, silent = FALSE, save_raw = TRUE)
> # jsonlite::write_json(res_json, "inst/extdata/journey.json")
> f = system.file(package = "cyclestreets", "extdata/journey.json")
> obj = jsonlite::read_json(f, simplifyVector = TRUE)
> rsf = json2sf_cs(obj, cols = c("distances"))
> names(rsf)
[1] "distances"        "elevation_start"  "elevation_end"    "gradient_segment"
[5] "elevation_change" "provisionName"    "geometry"        
> rsf
Simple feature collection with 5 features and 6 fields
Geometry type: LINESTRING
Dimension:     XY
Bounding box:  xmin: -1.54802 ymin: 53.7936 xmax: -1.54324 ymax: 53.79618
Geodetic CRS:  WGS 84
  distances elevation_start elevation_end gradient_segment elevation_change
1        87              27            28       0.01149425                1
2       234              28            33       0.02564103                6
3        18              33            32       0.05555556                1
4       131              32            34       0.01526718                2
5        36              34            34       0.00000000                0
      provisionName                       geometry
1 Unclassified road LINESTRING (-1.54408 53.793...
2         Main road LINESTRING (-1.54324 53.794...
3         Main road LINESTRING (-1.54624 53.795...
4         Main road LINESTRING (-1.54649 53.795...
5         Main road LINESTRING (-1.54747 53.796...
> rsf2 = json2sf_cs(obj, cols = NULL, cols_extra = NULL)
> names(rsf2)
 [1] "time"               "busynance"          "signalledJunctions"
 [4] "signalledCrossings" "name"               "walk"              
 [7] "elevations"         "distances"          "elevation_mean"    
[10] "elevation_start"    "elevation_end"      "elevation_max"     
[13] "elevation_min"      "gradient_mean"      "gradient_median"   
[16] "gradient_p75"       "gradient_max"       "gradient_segment"  
[19] "elevation_change"   "provisionName"      "start"             
[22] "finish"             "startSpeed"         "start_longitude"   
[25] "start_latitude"     "finish_longitude"   "finish_latitude"   
[28] "crow_fly_distance"  "event"              "whence"            
[31] "speed"              "itinerary"          "clientRouteId"     
[34] "plan"               "note"               "length"            
[37] "quietness"          "west"               "south"             
[40] "east"               "north"              "leaving"           
[43] "arriving"           "grammesCO2saved"    "calories"          
[46] "edition"            "flow"               "geometry"          
> # stplanr::line2points(rsf) extract start and end points
> sf:::plot.sf(rsf)
> json2sf_cs(obj, cols = c("time", "busynance", "elevations"))
Simple feature collection with 5 features and 8 fields
Geometry type: LINESTRING
Dimension:     XY
Bounding box:  xmin: -1.54802 ymin: 53.7936 xmax: -1.54324 ymax: 53.79618
Geodetic CRS:  WGS 84
  time busynance elevations elevation_start elevation_end gradient_segment
1   24       351         NA              27            28       0.01149425
2  105      1300         NA              28            33       0.02564103
3    5        34         NA              33            32       0.05555556
4   48       562         NA              32            34       0.01526718
5    9       180         NA              34            34       0.00000000
  elevation_change     provisionName                       geometry
1                1 Unclassified road LINESTRING (-1.54408 53.793...
2                6         Main road LINESTRING (-1.54324 53.794...
3                1         Main road LINESTRING (-1.54624 53.795...
4                2         Main road LINESTRING (-1.54649 53.795...
5                0         Main road LINESTRING (-1.54747 53.796...
> json2sf_cs(obj, cols = c("distances"), smooth_gradient = TRUE,
+   gradient_cutoff = 0.05, distance_cutoff = 50)
Loading required namespace: stplanr
Failed with error:  'there is no package called 'stplanr''
Please install stplanr
Error in smooth_with_cutoffs(r$gradient_segment, r$elevation_change, r$distances,  : 
  object 'gradient_segment_smooth' not found
Calls: json2sf_cs -> smooth_with_cutoffs
Execution halted