在 tidyverse 之后加载 Magick 包

Loading Magick package after tidyverse

我想在 R 中加载 magick 包,但不确定错误来自何处。使用 R 版本 4.0.5。我认为问题可能与 tidyverse 包有关,因为我在正确加载 magick 后安装了它,但现在它根本不起作用。使用 Windows 和 RStudio

library(magick)
Error: package or namespace load failed for ‘magick’:
 .onLoad failed in loadNamespace() for 'magick', details:
  call: set_magick_tempdir(tempdir())
  error: function 'Rcpp_precious_remove' not provided by package 'Rcpp'

最好不要将 tidyverse 作为包加载。也许,加载那些单独的包,即 library(dplyr);library(tidyr) 等,因为这无需加载 library(tidyverse)

library(magick)
Linking to ImageMagick 6.9.12.3
Enabled features: cairo, fontconfig, freetype, heic, lcms, pango, raw, rsvg, webp
Disabled features: fftw, ghostscript, x11

sessionInfo()的输出如下

> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.5.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] magick_2.7.2      lubridate_1.7.10  janitor_2.1.0     collapse_1.6.2    tibble_3.1.2      purrr_0.3.4       tidyr_1.1.3       dplyr_1.0.7       data.table_1.14.0
[10] overflow_0.2-4    stringr_1.4.0     reshape2_1.4.4   

loaded via a namespace (and not attached):
 [1] splines_4.1.0            gtools_3.8.2             Formula_1.2-4            latticeExtra_0.6-29      numDeriv_2016.8-1.1      pillar_1.6.1            
 [7] backports_1.2.1          lattice_0.20-44          glue_1.4.2               RcppEigen_0.3.3.9.1      digest_0.6.27            RColorBrewer_1.1-2      
[13] checkmate_2.0.0          snakecase_0.11.0         minqa_1.2.4              colorspace_2.0-1         sandwich_3.0-1           htmltools_0.5.1.1       
[19] Matrix_1.3-3             plyr_1.8.6               pkgconfig_2.0.3          broom_0.7.6              weights_1.0.4            scales_1.1.1            
[25] gdata_2.18.0             jpeg_0.1-8.1             lme4_1.1-27              htmlTable_2.2.1          generics_0.1.0           ggplot2_3.3.3           
[31] ellipsis_0.3.2           nnet_7.3-16              cli_2.5.0                survival_3.2-11          magrittr_2.0.1           crayon_1.4.1            
[37] ps_1.6.0                 mice_3.13.0              fansi_0.4.2              nlme_3.1-152             MASS_7.3-54              RcppArmadillo_0.10.4.0.0
[43] foreign_0.8-81           dreamerr_1.2.3           fixest_0.9.0             tools_4.1.0              lifecycle_1.0.0          munsell_0.5.0           
[49] cluster_2.1.2            compiler_4.1.0           rlang_0.4.11             grid_4.1.0               nloptr_1.2.2.2           rstudioapi_0.13         
[55] htmlwidgets_1.5.3        base64enc_0.1-3          boot_1.3-28              gtable_0.3.0             R6_2.5.0                 gridExtra_2.3           
[61] zoo_1.8-9                knitr_1.33               utf8_1.2.1               Hmisc_4.5-0              stringi_1.6.2            parallel_4.1.0          
[67] Rcpp_1.0.6               vctrs_0.3.8              rpart_4.1-15             png_0.1-7                tidyselect_1.1.1         xfun_0.23