I'm looking to integrate some awesome mapview interactive maps in a Jupyter Notebook with the IRkernel.

I would like to know if:

  • Is it possible? How can I achieve that?
  • Is there any workaround using Jupyter Notebook with IPython kernel using cell magics %%?

In a Jupyter Notebook cell, I tried:

# Load shapefile
shapefile <- sf::read_sf('../path/to/shapefile.shp')

# Plot mapview map

No luck, and no error message showed!

1 Answer 1


You can use:

  • the R package IRkernel and you are working in R

enter image description here

enter image description here


It works without problem (library(maptools))

enter image description here

with the result in another tab

enter image description here

  • Thanks for your help and effort but unfortunately, I couldn't run a mapview map using your trick. I tried loading the rpy2.ipython extension but It didn't work. I don't know If I'm missing something. Did you try using mapview?
    – Guz
    Jun 8, 2017 at 3:21
  • It works without problem, look above in New
    – gene
    Jun 8, 2017 at 15:05
  • thanks! Some problem don't let mapview work correctly: Warning in R_ut_init: Error parsing unit specification. Anyway, the question is answered.
    – Guz
    Jun 8, 2017 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.