简体   繁体   中英

Getting several errors in R - ggplot2 package won´t load

I am having a hard time trying to load some R packages. As an example, I provide below the errors I´m getting from ggplot2 package.

library(ggplot2) 
Erro: package or namespace load failed for ‘ggplot2’ in namespaceExport(ns, exports):
 undefined exports: ContinuousRange, DiscreteRange, Range, abs_area, alpha, area_pal, as.trans, asn_trans, atanh_trans, boxcox_trans, breaks_extended, breaks_log, breaks_pretty, breaks_width, brewer_pal, cbreaks, censor, col2hcl, col_bin, col_factor, col_numeric, col_quantile, colour_ramp, comma, comma_format, cscale, date_breaks, date_format, date_trans, demo_continuous, demo_datetime, demo_discrete, demo_log10, demo_time, dichromat_pal, discard, div_gradient_pal, dollar, dollar_format, dscale, exp_trans, expand_range, extended_breaks, format_format, fullseq, gradient_n_pal, grey_pal, hms_trans, hue_pal, identity_pal, identity_trans, is.trans, label_bytes, label_comma, label_date, label_date_short, label_dollar, label_math, label_number, label_number_auto, label_number_si, label_ordinal, label_parse, label_percent, label_pvalue, label_scientific, label_time, label_wrap, linetype_pal, log10_trans, lo
Além disso: Warning messages:
1: métodos S3 ‘fullseq.Date’, ‘fullseq.POSIXt’, ‘fullseq.difftime’, ‘fullseq.numeric’, ‘lines.trans’, ‘plot.trans’, ‘print.trans’, ‘rescale.NULL’, ‘rescale.Date’, ‘rescale.POSIXt’, ‘rescale.dist’, ‘rescale.integer64’, ‘rescale.logical’, ‘rescale.numeric’, ‘rescale_mid.NULL’, ‘rescale_mid.Date’, ‘rescale_mid.POSIXt’, ‘rescale_mid.dist’, ‘rescale_mid.integer64’, ‘rescale_mid.logical’, ‘rescale_mid.numeric’, ‘round_any.POSIXct’, ‘round_any.numeric’ foram declarados no NAMESPACE mas não encontrados 
2: métodos S3 ‘fullseq.Date’, ‘fullseq.POSIXt’, ‘fullseq.difftime’, ‘fullseq.numeric’, ‘lines.trans’, ‘plot.trans’, ‘print.trans’, ‘rescale.NULL’, ‘rescale.Date’, ‘rescale.POSIXt’, ‘rescale.dist’, ‘rescale.integer64’, ‘rescale.logical’, ‘rescale.numeric’, ‘rescale_mid.NULL’, ‘rescale_mid.Date’, ‘rescale_mid.POSIXt’, ‘rescale_mid.dist’, ‘rescale_mid.integer64’, ‘rescale_mid.logical’, ‘rescale_mid.numeric’, ‘round_any.POSIXct’, ‘round_any.numeric’ foram declarados no NAMESPACE mas não encontrados 

This is what I get after loading the package.

I´ve already uninstalled and reinstalled R(v4.0.3), and got the same errors from previous versions, and R Studio. I had also reinstalled this specific package more than once, and tried installing every package pointed to be a necessary auxiliary to this. I also installed R tools but nothing seemed to work. If anyone can help me to fix this, I appreciate.

## Edit: The warning messages from several other packages which are not working properly:

Warning messages:
1: In readLines(file, skipNul = TRUE) :
  não foi possível abrir o arquivo comprimido 'C:/Users/patyn/Documents/R/win-library/4.0/bmp/DESCRIPTION', motivo provável 'No such file or directory'
2: In readLines(file, skipNul = TRUE) :
  não foi possível abrir o arquivo comprimido 'C:/Users/patyn/Documents/R/win-library/4.0/farver/DESCRIPTION', motivo provável 'No such file or directory'
3: In readLines(file, skipNul = TRUE) :
  não foi possível abrir o arquivo comprimido 'C:/Users/patyn/Documents/R/win-library/4.0/labeling/DESCRIPTION', motivo provável 'No such file or directory'
4: In readLines(file, skipNul = TRUE) :
  não foi possível abrir o arquivo comprimido 'C:/Users/patyn/Documents/R/win-library/4.0/plogr/DESCRIPTION', motivo provável 'No such file or directory'
5: In readLines(file, skipNul = TRUE) :
  não foi possível abrir o arquivo comprimido 'C:/Users/patyn/Documents/R/win-library/4.0/readbitmap/DESCRIPTION', motivo provável 'No such file or directory'
6: In readLines(file, skipNul = TRUE) :
  não foi possível abrir o arquivo comprimido 'C:/Users/patyn/Documents/R/win-library/4.0/tiff/DESCRIPTION', motivo provável 'No such file or directory

Edit: After running update.packages() the packages won´t load and I still get these warnings:

Warning messages:
1: métodos S3 ‘fullseq.Date’, ‘fullseq.POSIXt’, ‘fullseq.difftime’, ‘fullseq.numeric’, ‘lines.trans’, ‘plot.trans’, ‘print.trans’, ‘rescale.NULL’, ‘rescale.Date’, ‘rescale.POSIXt’, ‘rescale.dist’, ‘rescale.integer64’, ‘rescale.logical’, ‘rescale.numeric’, ‘rescale_mid.NULL’, ‘rescale_mid.Date’, ‘rescale_mid.POSIXt’, ‘rescale_mid.dist’, ‘rescale_mid.integer64’, ‘rescale_mid.logical’, ‘rescale_mid.numeric’, ‘round_any.POSIXct’, ‘round_any.numeric’ foram declarados no NAMESPACE mas não encontrados 
2: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying C:\Users\patyn\Documents\R\win-library\4.0\00LOCK\backports\libs\x64\backports.dll to C:\Users\patyn\Documents\R\win-library\4.0\backports\libs\x64\backports.dll: Permission denied
3: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying C:\Users\patyn\Documents\R\win-library\4.0\00LOCK\colorspace\libs\x64\colorspace.dll to C:\Users\patyn\Documents\R\win-library\4.0\colorspace\libs\x64\colorspace.dll: Permission denied
4: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying C:\Users\patyn\Documents\R\win-library\4.0\00LOCK\digest\libs\x64\digest.dll to C:\Users\patyn\Documents\R\win-library\4.0\digest\libs\x64\digest.dll: Permission denied
5: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying C:\Users\patyn\Documents\R\win-library\4.0\00LOCK\testthat\libs\x64\testthat.dll to C:\Users\patyn\Documents\R\win-library\4.0\testthat\libs\x64\testthat.dll: Permission denied
6: In install.packages(update[instlib == l, "Package"], l, repos = repos,  :
  installation of package ‘ggraph’ had non-zero exit status
7: In install.packages(update[instlib == l, "Package"], l, repos = repos,  :
  installation of package ‘mice’ had non-zero exit status

Have you tried updating the packages?

Try update.packages() and let me know if this solves your problem.

I actually ran into a tutorial in which the person had the same errors from R while trying to load installed packages. What I did was to delete the folder of win-library in which the R version installed the packages, in my case, the 4.0 folder. Then I restarted R, reinstalled all the packages (including ggplot2) and it is working so far. If R starts returning errors again I´m coming back to tell.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM