Problem with tmap and R 4.0.0

Hi. Sorry for my English. I am from México. I have a problem with the package map since I install R 4.0.0. I developed an app that can show a dynamic map and I didn't have problems to upload to the Web until I installed R 4.0.0 and R Studio 1.3.959. So, I can run my app in a local window and see the map, but when I try to upload to the web, I can't.

I have tried a lot of things. For example, 1) make the polygons valids, 2) in the settings apps I disabled the Package Cache option, 3) I have installed the lwgeom package, 4) I have installed the sf package

I read that probably is a problem with R 4.0.0. So, I come to ask for your help. Thanks


  1. My code to build the map is:
tm <- tm_shape(map_and_data) +
  tm_fill("CASOS",id = "MUNICIPIO",  palette = "Reds" ,   breaks = c(0,0.5,10,100,max(edomun$CASOS)), labels = c ("0", "de 1 a 10", "de 10 a 100", paste("de 100 a", max(edomun$CASOS)) ) ) +
  tm_borders("grey25", alpha=.05) + 
  tm_layout( paste("Casos de COVID-19 por municipio al", names(input_c)[length(input_c)] ) ,
             main.title.position = "center") + tm_view(view.legend.position = c("left","bottom") )

  1. To run in the app I have the code:
 output$my_tmap = renderLeaflet({
  }  %>% 
    setView(lng = -102.180557, 22.675095, zoom = 5)  )
  1. When I run in local, I can see the map, but an error appears saying: "Warning in renderWidget(instance) :
    Ignoring appended content; appendContent can't be used in a Shiny render call"

  2. When I try to publish in web I have the error:

Error: Unhandled Exception: Child Task 745863941 failed: Error building image: Error building lwgeom (0.2-4). Build exited with non-zero status: 1
Execution halted

I appreciate your help

Take a look at this related thread

Thaks, I tried:


but I get this error:

Downloading GitHub repo r-spatial/lwgeom@master
Error: Failed to install 'lwgeom' from GitHub:
  Could not find tools necessary to compile a package
Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.

The, I run:


and I get the error:

Downloading GitHub repo r-spatial/lwgeom@master
✓  checking for file ‘/private/var/folders/1l/jhs00bs57c77fccyy12qn9ch0000gn/T/Rtmp3bCDVd/remotes698517c7ae2/r-spatial-lwgeom-0ac3113/DESCRIPTION’ (421ms)
─  preparing ‘lwgeom’:
✓  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘lwgeom_0.2-5.tar.gz’
* installing *source* package ‘lwgeom’ ...
** using staged installation
configure: CC: clang
configure: CXX: clang++
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking proj.h usability... no
checking proj.h presence... no
checking for proj.h... no
checking for pj_init_plus in -lproj... no
configure: error: libproj not found in standard or given locations.
ERROR: configuration failed for package ‘lwgeom’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/lwgeom’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/lwgeom’
Error: Failed to install 'lwgeom' from GitHub:
  (converted from warning) installation of package ‘/var/folders/1l/jhs00bs57c77fccyy12qn9ch0000gn/T//Rtmp3bCDVd/file6984daad3c1/lwgeom_0.2-5.tar.gz’ had non-zero exit status