Unable to load flextable - r

It shows there is no package called 'flextable' even after installing the package.
install.packages("flextable")
library(flextable)

Related

What to do when the package (qpcR) downloads in R but cannot use a function in the package?

I am trying to run an old script and I successfully downloaded the qpcR package. However, it will not let me use the HQIC command. I have tried uninstalling qpcR and reinstalling it. I keep getting the following error down below. What can I do?
Loading required package: MASS
Warning: package ‘MASS’ was built under R version 4.0.5
Loading required package: minpack.lm
Loading required package: rgl
Loading required package: robustbase
Warning: package ‘robustbase’ was built under R version 4.0.5
Loading required package: Matrix

Problem in RStudio with the dplyr package

Every time I try to load a package using library(dplyr) it gives me this error
message error: there is no package called ‘crayon’
I'm not sure what to do I have installed the packages.
You might also try installing another package that includes dplyr (like tidyverse) https://www.tidyverse.org/packages/
install.packages("tidyverse")
library(tidyverse)

Copy an object from R to a database file in Dropbox using RSQLite and dbplyr

I am using RStudio to copy an object of dimensions 4.3M rows and 88 columns from R to my Dropbox folder, which is synced with my laptop. I wrote the following code lines by following the first part of this code (https://github.com/tidyverse/dplyr/issues/3026)
library(dplyr)
con <- DBI::dbConnect(RSQLite::SQLite(), path = "./Users/[name]/Dropbox/src/[object that needs to be copied].sql")
ventra <- as.data.frame([filename])
copy_to(dest = con, ventra::ventra, "ventra", overwrite = F)
I got this error message: Error: The dbplyr package is required to communicate with database backends.
But after I installed dbplyr package using install.packages("dbplyr"), I tried to load library(dbplyr) only to get the following message
Error in unloadNamespace(package) : namespace ‘rlang’ is imported
by ‘hms’, ‘purrr’, ‘dplyr’, ‘tibble’, ‘tidyr’ so cannot be unloaded
Error in library("rlang", lib.loc ="/Library/Frameworks/R.framework/Versions/3.3/Resources/library") :
Package ‘rlang’ version 0.1.4 cannot be unloaded
So I tried removing tidyerse (ver. 1.2.1), dplyr (ver. 0.7.4), and then load rlang (ver. 0.1.6) and dbplyr (ver. 1.2.0), but Rstudio still gives the same error message.
My question: How do I correctly unload rlang (ver. 0.1.4)? Also, is my code above working as I wish to (meaning, would I get a file named ventra in my dropbox folder after I execute the 4 code lines above?)

Chart a map with highcharter

I am trying to chart a map with highcharter using the hcmap function:
devtools::install_github("jbkunst/highcharter")
library(highcharter)
hcmap("custom/south-america")
However, I get the following error:
Installing tidyr
Downloading GitHub repo RcppCore/Rcpp#master
from URL https://api.github.com/repos/RcppCore/Rcpp/zipball/master
Error: Could not find build tools necessary to build Rcpp
> library(highcharter)
> library(Rcpp)
Warning message:
package ‘Rcpp’ was built under R version 3.3.2
> hcmap("custom/south-america")
Error: could not find function "hcmap"

Rcmndr plugin not running

I am trying to run this rcmndr plugin for my class and it's not working. I installed all the necessary packages and it appeared to install correctly but I am getting this package or namespace load failure. The GUI appears for a split second when I enter the library command, then disappears with the error. It seems to be an issue with the namespace and .onattach but I couldn't find any existing answers or resources for this issue.
https://cran.r-project.org/web/packages/RcmdrPlugin.BCA/index.html
> library(RcmdrPlugin.BCA)
Loading required package: Rcmdr
Loading required package: splines
Loading required package: RcmdrMisc
Loading required package: car
Loading required package: sandwich
Rcmdr Version 2.2-3
Loading required package: BCA
Warning: package 'BCA' was built under R version 3.2.3
Loading required package: flexclust
Warning: package 'flexclust' was built under R version 3.2.3
Loading required package: grid
Loading required package: lattice
Loading required package: modeltools
Loading required package: stats4
Error : .onAttach failed in attachNamespace() for 'RcmdrPlugin.BCA', details:
call: get(Menus[m, 5])
error: object 'importRODBCtable' not found
In addition: Warning messages:
1: package ‘RcmdrPlugin.BCA’ was built under R version 3.2.3
2: package ‘Rcmdr’ was built under R version 3.2.3
3: package ‘RcmdrMisc’ was built under R version 3.2.3
4: package ‘car’ was built under R version 3.2.3
Error: package or namespace load failed for 'RcmdrPlugin.BCA'
I got alternative to run this plugin in R commander.
Open R Commander by using:
library(Rcmdr)
R Commander dialogue box will appear.
In R Script load BCA library-
lapply(list('BCA', 'splines', 'RcmdrMisc', 'car', 'sandwich', 'flexclust', 'grid','lattice','modeltools','stats4','RODBC'), require, character.only = TRUE)
Click on Submit button.
If you don't have RODBC package (which is not there in my case), install it separately and then run above commands. To install use:
install.packages("RODBC")
And now you exactly have what you will get after loading RcmdrPlugin.BCA library.
I faced a similar situation. Having tried a bunch of things - none worked - I finally uninstalled R and deleted the remaining files from under the "Program Files" directory in Windows. I then reinstalled R and RcmdrPlugin.BCA and this time it worked.
You could also refer to this URL for help http://r.789695.n4.nabble.com/Unable-to-run-RcmdrPlugin-survival-using-3-2-2-with-Windows-10-td4711796.html

Resources