R plumber and jsonlite packages conflict - package

I have plumber version 1.0.0 installed and I also installed jsonlite 1.7.1 when I try to load library(jsonlite) I get back:
Error in value[[3L]](cond) :
Package ‘jsonlite’ version 1.6 cannot be unloaded:
Error in unloadNamespace(package) : namespace ‘jsonlite’ is imported by ‘webutils’, ‘plumber’ so cannot be unloaded
In addition: Warning message:
package ‘jsonlite’ was built under R version 3.6.3
So I thought that some of jsonlite functions are already available through plumber, but toJSON(some_df, pretty = T) generates error:
Error in toJSON(some_df, pretty = T) : could not find function "toJSON"
Any thoughts?

Related

I can activate xlsx package in R

I've just set up the new version of RStudio and the new version of Java as well in my laptop, and started to install all the packages in R (Tidyverse, xlsx...) but when it comes to activating xlsx (once already installed) R gives me this error:
"Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
In addition: Warning message:
package ‘xlsx’ was built under R version 4.1.3"
I would appreciate it if somebody could help me with that.
Thank you very much.

JupyterLab nvdashboard failed to install in Jupyter >= 3.0 with react >= 17.0.0

I would like to use the jupyterlab-nvdashboard to monitor the GPU performance from JupyterLab. Although it is not mentioned in the github, I found the extension is also available in the conda-forge channel and I installed it from there.
conda install -c conda-forge jupyterlab-nvdashboard
The installation went without errors and the last environment list entry shows that jupyterlab-nvdashboard-0.6.0 was installed together with the dependency pynvml-11.0.0:
2021-10-21 12:15:21 (rev 8)
+jupyterlab-nvdashboard-0.6.0 (conda-forge/noarch)
+pynvml-11.0.0 (conda-forge/noarch)
I am running a recent version of jupyter-lab >= 3.0
$ jupyter --version
Selected Jupyter core packages...
IPython : 7.28.0
ipykernel : 6.4.1
ipywidgets : not installed
jupyter_client : 7.0.6
jupyter_core : 4.8.1
jupyter_server : 1.11.1
jupyterlab : 3.1.18
This is the error I am getting when I tried to install the labextension.
$ jupyter labextension install jupyterlab-nvdashboard
An error occurred.
ValueError: The extension "jupyterlab-nvdashboard" does not yet support the current version of JupyterLab.
Conflicting Dependencies:
JupyterLab Extension Package
>=3.1.17 <3.2.0 >=2.0.0 <3.0.0 #jupyterlab/application
>=3.1.17 <3.2.0 >=2.0.0 <3.0.0 #jupyterlab/apputils
>=5.1.17 <5.2.0 >=4.0.0 <5.0.0 #jupyterlab/coreutils
>=17.0.1 <18.0.0 >=16.4.2 <17.0.0 react
>=17.0.1 <18.0.0 >=16.9.0 <17.0.0 react-dom
And this is the output of the server extension list command:
$ jupyter server extension list
Config dir: /home/<username>/.jupyter
Config dir: /home/<username>/anaconda3/envs/test/etc/jupyter
dask_labextension enabled
- Validating dask_labextension...
dask_labextension 5.1.0 OK
jupyter_server_proxy enabled
- Validating jupyter_server_proxy...
jupyter_server_proxy OK
jupyterlab enabled
- Validating jupyterlab...
jupyterlab 3.1.18 OK
jupyterlab_nvdashboard enabled
- Validating jupyterlab_nvdashboard...
X validation failed
I realized the dashboard works inside JupyterLab despite jupyter labextension telling me the X validation failed. So all good. =)

How to install mixOmics packages in R version 4.0.0?

I have tried install package mixOmics but failed.
The output at console below:
install.packages("mixOmics")
Installing package into ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘mixOmics’ is not available (for R version 4.0.0)
I have also tried it at R version 3.5.2 and still failed.
May you help me please
Mixomics install is now only available through Bioconductor.
http://www.bioconductor.org/packages/release/bioc/html/mixOmics.html

bibliometrix (Problem in uploading the data)

I am trying to do bibliometrix analysis of articles using the bibliometrix package. I installed the package and then run the library.However, when I am uploading my data, it is showing this error:
Error in readFiles("C:/Users/patel/savedrecs.bib") : could not find
function "readFiles".
Also. when I am running library this is the massage I am getting.
library(bibliometrix) ### load bibliometrix package
Error: package or namespace load failed for ‘bibliometrix’: object
‘scale_type’ is not exported by 'namespace:ggplot2'
In addition:
Warning message: package ‘bibliometrix’ was built under R version
3.4.4
My question is how to upload data? Please help me.
Try to download the package directly from the github repository:
install.packages("devtools")# to install the bibliometrix most recent version from GITHUB
devtools::install_github("massimoaria/bibliometrix")
Beware! The github version, usually, is the most recent and not fixed one.
For windows, I had to install Rtools from https://cran.r-project.org/bin/windows/Rtools/
Then I did the following installs in RStudio
> install.packages("bibliometrix", dependencies=TRUE)
> library(bibliometrix)
To cite bibliometrix in publications, please use:
Aria, M. & Cuccurullo, C. (2017) bibliometrix: An R-tool for comprehensive science mapping analysis, Journal of Informetrics, 11(4), pp 959-975, Elsevier.
http:\\www.bibliometrix.org
To start with the shiny web-interface, please digit:
biblioshiny()
> biblioshiny()
Only then all such prerequisite problems got resolved. Without RTools, all such errors were getting reported.
I re-installed the rtools, then installed the jsonlite package and lastly, installed the bibliometrix package.
now it's working.

build R package failing with rJava LoadLibrary "not a valid win32 application" failure

I wrote an R package to connect R with messageQueues, specifically activeMQ and rabbitMQ, so all the source can be found here: http://r-forge.r-project.org/projects/r-message-queue/
r-forge fails to build the package, so I'm recreating/debugging locally, but my local build fails earlier in the process than r-forge.
I'm running 64bit windows7, 64bit R v2.15.2.
If I'm going about this the wrong way, let me know.
BUILDING the R package
$ R --verbose CMD build messageQueue
* checking for file 'messageQueue/DESCRIPTION' ... OK
* preparing 'messageQueue':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building 'messageQueue_0.1.tar.gz'
cygwin warning:
MS-DOS style path detected: C:/Users/msm336/workspace_r/messageQueue_0.1.tar.gz
Preferred POSIX equivalent is: /cygdrive/c/Users/msm336/workspace_r/messageQueue_0.1.tar.gz
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
CHECKING the R package
$ R --verbose CMD check messageQueue_0.1.tar.gz
* using log directory 'C:/Users/msm336/workspace_r/messageQueue.Rcheck'
* using R version 2.15.2 (2012-10-26)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* checking for file 'messageQueue/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'messageQueue' version '0.1'
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking whether package 'messageQueue' can be installed ... ERROR
Installation failed.
See 'C:/Users/msm336/workspace_r/messageQueue.Rcheck/00install.out' for details.
CONTENTS of messageQueue.Rcheck/00install.out
* installing *source* package 'messageQueue' ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Program Files/R/R-2.15.2/library/rJava/libs/i386/rJava.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
Error : package 'rJava' could not be loaded
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/msm336/workspace_r/messageQueue.Rcheck/messageQueue'
I'm not sure why it's trying to load the i386 version of rJava, when I'm running x64 R on Windows7 x64 using a 64bit version of java:
$ java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
I've also got the JAVA_HOME/jre/bin/server/jvm.dll on my path, because rJava likes that somehow.
Any help would be greatly appreciated.
Thanks,
Matt.
By default, R's check function will try to test the package against all relevant architectures. On a windows7 x64 machine, this means it will try testing the package against both i386 and x64.
Unfortunately, when running R x64 with a x64 JDK, it seems to not manage architecture dependencies cleanly, thus tries to load a i386 DLL (/rJava/libs/i386/rJava.dll) within an x64 context and fails. I don't fully understand why, but can work around it.
Forcing R CMD check messageQueue to run against the current (default) architecture can be done using the --no-multiarch switch. It is documented in the Writing R Extensions manual, Section 1.3.1 (see: Multiple sub-architectures near the end).
My updated R command to check only against the current architecture:
R --verbose CMD check --no-multiarch messageQueue_0.1.tar.gz
Awesome.

Resources