@@ -113,6 +113,8 @@ test_that("plot_ly() defaults to blank axes", {
113113})
114114
115115test_that(" discrete color informs fillcolor" , {
116+ skip_if_not_installed(" sf" )
117+
116118 res <- unique(res_mn $ INDRESNAME )
117119 cols <- viridisLite :: magma(length(res ))
118120
@@ -132,6 +134,8 @@ test_that("discrete color informs fillcolor", {
132134
133135
134136test_that(" discrete color informs fillcolor" , {
137+ skip_if_not_installed(" sf" )
138+
135139 res <- unique(res_mn $ INDRESNAME )
136140 cols <- viridisLite :: magma(length(res ))
137141
@@ -166,6 +170,7 @@ test_that("discrete color informs fillcolor", {
166170
167171
168172test_that(" numeric color informs fillcolor" , {
173+ skip_if_not_installed(" sf" )
169174
170175 p <- plot_mapbox(res_mn , color = ~ AREA )
171176 expect_warning(plotly_build(p ), " Only one fillcolor per trace allowed" )
@@ -209,6 +214,7 @@ test_that("numeric color informs fillcolor", {
209214
210215
211216test_that(" sizing constants" , {
217+ skip_if_not_installed(" sf" )
212218
213219 # span controls 'stroke-size'
214220 p <- plot_mapbox(res_mn , span = I(5 )) %> % plotly_build()
@@ -253,6 +259,7 @@ test_that("sizing constants", {
253259
254260
255261test_that(" size mappings" , {
262+ skip_if_not_installed(" sf" )
256263
257264 expect_warning(
258265 plotly_build(plot_mapbox(res_mn , span = ~ PERIMETER )),
@@ -287,6 +294,7 @@ test_that("size mappings", {
287294
288295
289296test_that(" altogether now" , {
297+ skip_if_not_installed(" sf" )
290298
291299 s <- subplot(plot_ly(nc ), plot_geo(nc ), plot_mapbox(nc ), nrows = 3 ) %> % plotly_build()
292300 d <- s $ x $ data
@@ -320,6 +328,7 @@ test_that("altogether now", {
320328
321329
322330test_that(" color and stroke scales can be set independently" , {
331+ skip_if_not_installed(" sf" )
323332
324333 n <- length(unique(res_mn $ INDRESNAME ))
325334 p <- plot_mapbox(res_mn , split = ~ INDRESNAME , color = ~ AREA , stroke = ~ PERIMETER , span = I(2 )) %> %
0 commit comments