Failed to load library tidyr in R (version 4.1) - r

I need to use the functions spread and gather in the package of tidyr, and I installed this package. I also installed two other packages. However, when I tried to use library(tidyr), it gave me this long error message, basically saying tidyr was not successfully loaded. By the way, my R is a newer version (4.1). Thanks!
install.packages("tidyr")
install.packages("tidyverse")
install.packages("devtools")
Here's the error message:
Error: package or namespace load failed for ‘tidyr’ in namespaceExport(ns, exports):
undefined exports: align, char, colonnade, ctl_new_pillar, ctl_new_pillar_list, dim_desc, expect_known_display, extra_cols, format_glimpse, format_type_sum, get_extent, get_max_extent, glimpse, is_vector_s3, new_ornament, new_pillar, new_pillar_component, new_pillar_shaft, new_pillar_shaft_simple, new_pillar_title, new_pillar_type, num, obj_sum, pillar, pillar_component, pillar_shaft, scale_x_num, scale_y_num, set_char_opts, set_num_opts, size_sum, squeeze, style_bold, style_na, style_neg, style_num, style_subtle, style_subtle_num, tbl_format_body, tbl_format_footer, tbl_format_header, tbl_format_setup, tbl_sum, type_sum
In addition: Warning messages:
1: package ‘tidyr’ was built under R version 4.1.2
2: S3 methods ‘as_tbl.data.frame’, ‘ctl_new_pillar.tbl’, ‘ctl_new_pillar_list.tbl’, ‘extra_cols.pillar_squeezed_colonnade’, ‘format.pillar’, ‘format.pillar_1e’, ‘format.pillar_capital’, ‘format.pillar_char’, ‘format.pillar_char_attr’, ‘format.pillar_colonnade’, ‘format.pillar_continuation_shaft’, ‘format.pillar_num’, ‘format.pillar_num_attr’, ‘format.pillar_ornament’, ‘format.pillar_rif_shaft’, ‘format.pillar_rif_title’, ‘format.pillar_rif_type’, ‘format.pillar_shaft’, ‘format.pillar_shaft_decimal’, ‘format.pillar_shaft_simple’, ‘format.pillar_squeezed_colonnade’, ‘format.pillar_tbl_format_setup’, ‘format.pillar_title’, ‘format.pillar_type’, ‘format.tbl’, ‘format_glimpse.character’, ‘format_glimpse.default’, ‘format_glimpse.factor’, ‘format_glimpse.list’, ‘format_type_sum.AsIs’, ‘format_type_sum.default’, ‘glimpse.data.frame’, ‘glimpse.default’, ‘glimpse.tbl’, ‘obj_print_data.pillar_vctr’, ‘obj_print_footer.pillar_vctr’, ‘obj_print_header.pillar_vctr’, ‘obj_sum.AsIs’, ‘obj_sum.default’, ‘ [... truncated]

Related

Not able to use ggplot and gives an error

I installed ggplot2 with all the dependencies = TRUE
When I try to plot something, I get this error. Please help!
I tried uninstalling and installing R studio again but no success
Error in namespaceExport(ns, exports) :
undefined exports: AES, digest, digest2int, getVDigest, sha1, sha1_attr_digest, sha1_digest, hmac, makeRaw
In addition: Warning message:
S3 methods ‘print.AES’, ‘sha1.anova’, ‘sha1.array’, ‘sha1.call’, ‘sha1.character’, ‘sha1.complex’, ‘sha1.data.frame’, ‘sha1.Date’, ‘sha1.default’, ‘sha1.integer’, ‘sha1.factor’, ‘sha1.formula’, ‘sha1.function’, ‘sha1.logical’, ‘sha1.list’, ‘sha1.matrix’, ‘sha1.name’, ‘sha1.NULL’, ‘sha1.numeric’, ‘sha1.pairlist’, ‘sha1.POSIXct’, ‘sha1.POSIXlt’, ‘sha1.raw’, ‘sha1.(’, ‘makeRaw.default’, ‘makeRaw.digest’, ‘makeRaw.character’, ‘makeRaw.raw’ were declared in NAMESPACE but not found
[![Restart R and installed Digest : Following error occurs][1]][1]
[1]: https://i.stack.imgur.com/ARAwB.png

Problem in loading library for VIM package

Using R version R.4.0.3. Already installed the VIM package. When I try to load the library function as library(VIM), it fails to load and gives me the following error message:
Error: package or namespace load failed for ‘VIM’ in namespaceExport(ns, exports):
undefined exports: as_factor, fct_anon, fct_c, fct_collapse, fct_count, fct_cross, fct_drop, fct_expand, fct_explicit_na, fct_infreq, fct_inorder, fct_inseq, fct_lump, fct_lump_lowfreq, fct_lump_min, fct_lump_n, fct_lump_prop, fct_match, fct_other, fct_recode, fct_relabel, fct_relevel, fct_reorder, fct_reorder2, fct_rev, fct_shift, fct_shuffle, fct_unify, fct_unique, first2, last2, lvls_expand, lvls_reorder, lvls_revalue, lvls_union
In addition: Warning message:
S3 methods ‘as_factor.character’, ‘as_factor.factor’, ‘as_factor.logical’, ‘as_factor.numeric’ were declared in NAMESPACE but not found

Can't load dplyr package

I am very new to R programming and When I have tried to run "require(dplyr)", I get this error. I can't figure out why
Loading required package: dplyr
Error: package or namespace load failed for ‘dplyr’ in library.dynam(lib, package, package.lib):
shared object ‘tibble.so’ not found
Warning message:
S3 methods ‘$.tbl_df’, ‘[.tbl_df’, ‘[[.tbl_df’, ‘row.names<-.tbl_df’, ‘as.data.frame.tbl_df’, ‘as_data_frame.NULL’, ‘as_data_frame.data.frame’, ‘as_data_frame.default’, ‘as_data_frame.list’, ‘as_data_frame.matrix’, ‘as_data_frame.table’, ‘as_data_frame.tbl_df’, ‘as_tibble.NULL’, ‘as_tibble.data.frame’, ‘as_tibble.default’, ‘as_tibble.list’, ‘as_tibble.matrix’, ‘as_tibble.poly’, ‘as_tibble.table’, ‘as_tibble.tbl_df’, ‘as_tibble.ts’, ‘check_names_before_after.character’, ‘check_names_before_after.default’, ‘check_names_df.character’, ‘check_names_df.default’, ‘check_names_df.logical’, ‘check_names_df.numeric’, ‘format.tbl’, ‘format.tbl_df’, ‘format.trunc_mat’, ‘format_v.character’, ‘format_v.default’, ‘format_v.list’, ‘glimpse.data.frame’, ‘glimpse.default’, ‘glimpse.tbl’, ‘print.tbl’, ‘print.tbl_df’, ‘print.trunc_mat’, ‘quote_n.cha [... truncated]
It is not an elegant solution but have you tried
install.packages('tidyverse')

Error when installing quantmod in r

I am Trying to install "quantmod" in R but I can't manage. I tried unistalling and installing R again, and updating to the lastest version. I use windows. I get the following errors:
> library(quantmod)
Loading required package: TTR
Error: package or namespace load failed for ‘TTR’ in namespaceExport(ns, exports):
undefined exports: curl, curl_download, curl_echo, curl_escape, curl_fetch_disk, curl_fetch_memory, curl_fetch_multi, curl_fetch_stream, curl_options, curl_unescape, curl_version, form_data, form_file, handle_cookies, handle_data, handle_reset, handle_setform, handle_setheaders, handle_setopt, has_internet, ie_get_proxy_for_url, ie_proxy_info, multi_add, multi_cancel, multi_list, multi_run, multi_set, new_handle, new_pool, nslookup, parse_date, parse_headers
Error: package ‘TTR’ could not be loaded
In addition: Warning message:
S3 methods ‘print.curl_handle’, ‘print.curl_multi’, ‘print.form_data’, ‘print.form_file’ were declared in NAMESPACE but not found
When trying to install TTR:
> library(TTR)
Error: package or namespace load failed for ‘TTR’ in namespaceExport(ns, exports):
undefined exports: curl, curl_download, curl_echo, curl_escape, curl_fetch_disk, curl_fetch_memory, curl_fetch_multi, curl_fetch_stream, curl_options, curl_unescape, curl_version, form_data, form_file, handle_cookies, handle_data, handle_reset, handle_setform, handle_setheaders, handle_setopt, has_internet, ie_get_proxy_for_url, ie_proxy_info, multi_add, multi_cancel, multi_list, multi_run, multi_set, new_handle, new_pool, nslookup, parse_date, parse_headers
In addition: Warning message:
S3 methods ‘print.curl_handle’, ‘print.curl_multi’, ‘print.form_data’, ‘print.form_file’ were declared in NAMESPACE but not found
PF: I get a similar error when trying to execute the "forecast" package
> library(forecast)
Error: package or namespace load failed for ‘forecast’ in namespaceExport(ns, exports):
undefined exports: curl, curl_download, curl_echo, curl_escape, curl_fetch_disk, curl_fetch_memory, curl_fetch_multi, curl_fetch_stream, curl_options, curl_unescape, curl_version, form_data, form_file, handle_cookies, handle_data, handle_reset, handle_setform, handle_setheaders, handle_setopt, has_internet, ie_get_proxy_for_url, ie_proxy_info, multi_add, multi_cancel, multi_list, multi_run, multi_set, new_handle, new_pool, nslookup, parse_date, parse_headers
In addition: Warning message:
S3 methods ‘print.curl_handle’, ‘print.curl_multi’, ‘print.form_data’, ‘print.form_file’ were declared in NAMESPACE but not found
Linux terminal:
sudo apt-get install libcurl4-openssl-dev
R console:
install.packages("quantmod")

R namespace problems with 'logging' package

I'm writing an R package that uses the logging package from CRAN. In my code, I initialize logging when my package is loaded:
#' #importFrom logging basicConfig
.onAttach <- function(libname, pkgname) {
logging::basicConfig()
}
#' #importFrom logging setLevel
#' #export
setLogLevel <- function(level) {
setLevel(level)
}
And in my DESCRIPTION file I declare the dependency:
Depends:
R (>= 3.0.2),
Rcpp (>= 0.11.2)
Imports:
FNN,
plyr,
geosphere,
logging
However, it looks like R CMD check (which I invoke via "Check Package" in RStudio) doesn't like something about the namespaces:
* checking whether the package can be loaded with stated dependencies ... WARNING
Loading required package: Rcpp
Error : .onAttach failed in attachNamespace() for ‘ABC’, details:
call: UseMethod("updateOptions")
error: no applicable method for ‘updateOptions’ applied to an object of class "Logger"
Error: package or namespace load failed for ‘ABC’
Execution halted
It looks like this package (or one of its dependent packages) has an
unstated dependence on a standard package. All dependencies must be
declared in DESCRIPTION.
See the information on DESCRIPTION files in the chapter ‘Creating R
packages’ of the ‘Writing R Extensions’ manual.
...
* checking for missing documentation entries ... ERROR
Error: package or namespace load failed for ‘ABC’
Call sequence:
2: stop(gettextf("package or namespace load failed for %s", sQuote(package)),
call. = FALSE, domain = NA)
1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose = FALSE)
Execution halted
Exited with status 1.
The updateOptions() method it's complaining about is part of the logging::basicConfig() function I call in my initialization:
> logging::basicConfig
function (level = 20)
{
rootLogger <- getLogger()
updateOptions(rootLogger, level = namedLevel(level))
rootLogger$addHandler("basic.stdout", writeToConsole, level = namedLevel(level))
invisible()
}
<environment: namespace:logging>
d> logging::updateOptions
function (container, ...)
UseMethod("updateOptions")
<environment: namespace:logging>
Thanks for any insight anyone can provide.

Resources