R is not able to load certain libraries

Rstudio Version: 1.4.1106
RProgram: R-4.0.5

Below are certain libraries I want to use in my code, I have installed the packages, but I am unable to load them in the code as it is throwing error.
packages: openxlsx, reshape2, ggrepel

> rm(list=ls())
> # Required Libraries
> library(magrittr)
> library(lubridate)

Attaching package: ‘lubridate’

The following objects are masked from ‘package:base’:

    date, intersect, setdiff, union

> library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

> library(openxlsx)
Error: package or namespace load failed for ‘openxlsx’ in namespaceExport(ns, exports):
 undefined exports: Module, Rcpp.package.skeleton, populate, loadRcppModules, setRcppClass, loadRcppClass, loadModule, cppFunction, exposeClass, evalCpp, sourceCpp, compileAttributes, registerPlugin, RcppLdFlags, LdFlags, demangle, sizeof, cpp_object_initializer, cpp_object_dummy, Rcpp.plugin.maker, getRcppVersion
In addition: Warning message:
S3 methods ‘.DollarNames.C++Object’, ‘.DollarNames.Module’, ‘print.bytes’, ‘format.Rcpp_stack_trace’, ‘str.Rcpp_stack_trace’, ‘print.Rcpp_stack_trace’ were declared in NAMESPACE but not found 
> library(ggplot2)
> library(ggrepel)
Error: package or namespace load failed for ‘ggrepel’ in namespaceExport(ns, exports):
 undefined exports: Module, Rcpp.package.skeleton, populate, loadRcppModules, setRcppClass, loadRcppClass, loadModule, cppFunction, exposeClass, evalCpp, sourceCpp, compileAttributes, registerPlugin, RcppLdFlags, LdFlags, demangle, sizeof, cpp_object_initializer, cpp_object_dummy, Rcpp.plugin.maker, getRcppVersion
In addition: Warning message:
S3 methods ‘.DollarNames.C++Object’, ‘.DollarNames.Module’, ‘print.bytes’, ‘format.Rcpp_stack_trace’, ‘str.Rcpp_stack_trace’, ‘print.Rcpp_stack_trace’ were declared in NAMESPACE but not found 
> library(reshape2)
Error: package or namespace load failed for ‘reshape2’ in namespaceExport(ns, exports):
 undefined exports: Module, Rcpp.package.skeleton, populate, loadRcppModules, setRcppClass, loadRcppClass, loadModule, cppFunction, exposeClass, evalCpp, sourceCpp, compileAttributes, registerPlugin, RcppLdFlags, LdFlags, demangle, sizeof, cpp_object_initializer, cpp_object_dummy, Rcpp.plugin.maker, getRcppVersion
In addition: Warning message:
S3 methods ‘.DollarNames.C++Object’, ‘.DollarNames.Module’, ‘print.bytes’, ‘format.Rcpp_stack_trace’, ‘str.Rcpp_stack_trace’, ‘print.Rcpp_stack_trace’ were declared in NAMESPACE but not found 
> library(tidyr)

Attaching package: ‘tidyr’

The following object is masked from ‘package:magrittr’:

    extract

It seems you have problems with your Rcpp installation, try reinstalling the package

install.packages("Rcpp")

BTW, RStudio is an IDE for the R programming language but it doesn't affect your R package library so the problem is not directly related to it.

I installed and loaded the package(Rcpp) still there is no change

library(openxlsx)
Error: package or namespace load failed for ‘openxlsx’ in namespaceExport(ns, exports):
undefined exports: Module, Rcpp.package.skeleton, populate, loadRcppModules, setRcppClass, loadRcppClass, loadModule, cppFunction, exposeClass, evalCpp, sourceCpp, compileAttributes, registerPlugin, RcppLdFlags, LdFlags, demangle, sizeof, cpp_object_initializer, cpp_object_dummy, Rcpp.plugin.maker, getRcppVersion
In addition: Warning message:
S3 methods ‘.DollarNames.C++Object’, ‘.DollarNames.Module’, ‘print.bytes’, ‘format.Rcpp_stack_trace’, ‘str.Rcpp_stack_trace’, ‘print.Rcpp_stack_trace’ were declared in NAMESPACE but not found

Error in read.xlsx(paste0("D:/Users......"))
could not find function "read.xlsx"

Error in namespaceExport(ns, exports) :
undefined exports: Module, Rcpp.package.skeleton, populate, loadRcppModules, setRcppClass, loadRcppClass, loadModule, cppFunction, exposeClass, evalCpp, sourceCpp, compileAttributes, registerPlugin, RcppLdFlags, LdFlags, demangle, sizeof, cpp_object_initializer, cpp_object_dummy, Rcpp.plugin.maker, getRcppVersion
In addition: Warning message:
S3 methods ‘.DollarNames.C++Object’, ‘.DollarNames.Module’, ‘print.bytes’, ‘format.Rcpp_stack_trace’, ‘str.Rcpp_stack_trace’, ‘print.Rcpp_stack_trace’ were declared in NAMESPACE but not found

Resolved after Installing the packages by manually downloading as zip file and installing as 'Package Archive File(.zip, .tar, .gz)'

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.