library(caret) returns namespace load failed and Object sigma not found - namespaces

I have reviewed and did all the recommended actions here for caret package with no luck, I am still getting this error.
> library(caret)
Error in get(n, ns) : object 'sigma' not found
Error: package or namespace load failed for ‘caret’
I have reinstalled R and the package as well but still receiving the same error. This is my sessionInfo()
sessionInfo()
R version 3.2.5 (2016-04-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 10586)
locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_2.1.0 lattice_0.20-33 stringi_1.0-1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.4 codetools_0.2-14 foreach_1.4.3 MASS_7.3-45
[5] grid_3.2.5 plyr_1.8.3 nlme_3.1-127 gtable_0.2.0
[9] magrittr_1.5 scales_0.4.0 reshape2_1.4.1 minqa_1.2.4
[13] nloptr_1.0.4 Matrix_1.2-4 splines_3.2.5 lme4_1.1-12
[17] iterators_1.0.8 tools_3.2.5 stringr_1.0.0 munsell_0.4.3
[21] parallel_3.2.5 colorspace_1.2-6 nnet_7.3-12`
Note: I posted this question after completely trying all the solutions.

I faced the same issue, so that's how I tackled it:
I've downloaded oldest version of pbrktest package (it used by caret somehow) from CRAN, here's link https://cran.r-project.org/web/packages/pbkrtest/index.html
Then I've installed it, loaded it, and after that caret was available.
Hope it'll help you.

Related

RSession fatal error when trying to connect do MySQL database via RMariaDB

Recently my R on Windows 10 breaks down when trying to connect to a MySQL database using RMariaDB. The same error occurs when using RMySQL drivers as well. The error just appeared. The exact same code worked flawlessly about a year ago.
I am using the following code:
mydb <- DBI::dbConnect(drv = RMariaDB::MariaDB(),
default.file = "path/rds-combined-ca-bundle.pem",
username = "some_username",
password = "some_password",
host = "some_host",
port = 3306)
The second I run the dbConnect command, R crashes with the following error:
RSession Aborted
R encountered a fatal error.
The session was terminated.
My sessionInfo before executing the command is as follows:
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] data.table_1.12.8 RMariaDB_1.0.9
loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 zeallot_0.1.0 crayon_1.3.4 checkpoint_0.4.7 DBI_1.1.0 backports_1.1.5
[7] pillar_1.4.3 rlang_0.4.2 vctrs_0.2.1 tools_3.6.1 bit64_0.9-7 bit_1.1-15.2
[13] hms_0.5.2 compiler_3.6.1 pkgconfig_2.0.3 tibble_2.1.3
My RStudio diagnostics file shows the following issue:
17 Jul 2020 22:27:28 [rsession-XXX] ERROR system error 10053 (An established connection was aborted by the software in your host machine) [request-uri=/events/get_events]; OCCURRED AT: void __cdecl rstudio::session::HttpConnectionImpl<class rstudio_boost::asio::ip::tcp>::sendResponse(const class rstudio::core::http::Response &) c:\jenkins\workspace\ide\windows-v1.2\src\cpp\session\http\SessionHttpConnectionImpl.hpp:111; LOGGED FROM: void __cdecl rstudio::session::HttpConnectionImpl<class rstudio_boost::asio::ip::tcp>::sendResponse(const class rstudio::core::http::Response &) c:\jenkins\workspace\ide\windows-v1.2\src\cpp\session\http\SessionHttpConnectionImpl.hpp:116
So it would seem that there is some issue outside of R, potentially with a firewall or anti-virus software. Consequently, I have added RStudio and all RSessions in the list to the Windows Defender "Allowed Apps" list and tried disabling both Windows Defender and Symantec Endpoint Protection. However, the error keeps occurring. Any advice would be much appreciated.
default.file is a configuration file, not a certificate.

nvidia-smi fails when an incompatible nvml library included

Accidentally an incompatible nvml library was added to the library path in a linux environment. In that setup when I try to query nvidia-smi, it gives out the following error
Failed to initialize NVML: Driver/library version mismatch
And when I remove that incompatible library from the library path and query nvidia-smi again, the query runs successfully and the output is displayed as expected.
Yet, when I look into the dependent libraries by entering ldd for nvidia-smi it does not show that the process depends on the nvml library.
$>ldd /usr/bin/nvidia-smi
linux-vdso.so.1 => (0x00007fffa84db000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f58ba044000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f58b9e3f000)
libc.so.6 => /lib64/libc.so.6 (0x00007f58b9a7e000)
librt.so.1 => /lib64/librt.so.1 (0x00007f58b9876000)
/lib64/ld-linux-x86-64.so.2 (0x00007f58ba27d000)
If it does not depend on the nvml library, why does it give out an error when there is an incompatible nvml library?
ldd provides a list of application dependencies on libraries that are dynamically linked to the application.
Presumably this application uses runtime loading of a (shared) library (for example, strace nvidia-smi 2>&1 |grep ml)
When loading a library at runtime, it is not necessary to explicitly link the application against the library, and the library will not show up as a dependency in ldd output (if it is not explicitly linked at application build time).

RMySQL system error: 10060

I have a project with a connection that was working properly on the same device. I suddenly got the error below. And I could connect from the same device through MySQL workbench.
What could be the reason?
library(RMySQL)
con <- dbConnect(RMySQL::MySQL(),
host = "xxx",
dbname="yyy",
user = "zzz",
password = "############")
Error in .local(drv, ...) :
Failed to connect to database: Error: Lost connection to MySQL server at 'reading authorization packet', system error: 10060
And here's the session info
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RMySQL_0.10.10 DBI_0.4-1
loaded via a namespace (and not attached):
[1] tools_3.3.1
My code started having this exact problem after doing a system wide package update on 3/29/2017 for the first time since 2/1/2017.
Looking at the versioning for RMySQL,
RMySQL_0.10.9.tar.gz published 2016-05-08 15:39
RMySQL_0.10.10.tar.gz published 2017-03-21 07:50
I reverted my version to 0.10.9 and the problem went away:
require(devtools)
install_version("RMySQL", version = "0.10.9", repos = "http://cran.us.r-project.org")
I posted your issue to the RMySQL bug page, so we'll see if they address it
I checked another latest version of RMySQL package recently, RMySQL_0.10.11.zip
The problem exists in that too.
Apologies, cant comment as not allowed currently, hence wanted to update about the version where the problem is still being seen.
Additional Info
Connection to MySQL on my system is working from
1) Cmdline
2) MySQL Workbench
3) Tableau
4) Excel
It is just not working on R.
I checked following
link1
link2
link3
SHOW GLOBAL STATUS like 'Aborted%clients%';
And every time connection is dropped from R, the value of above variable goes +1.
Even doing
SET GLOBAL connect_timeout = 10;
has not helped.
UPDATE
Is there a dependency/requirement for PERL to be installed for usage of RMySQL?
As of now, my system does not have PERL. if this requirement is indeed true, then that might be 1 of the reason and may be the latest version has the problem fixed. Please let me know about the PERL dependency?
I was able to fix this issue on my PC using R 3.4 by following #Page's advice to look into the package versioning. However, not only did I need to install an earlier version of RMySQL (reverting from 0.10.11 to 0.10.9), I also needed to change versions on its dependancy package DBI (reverting from 0.6-1 to 0.5), using the following command:
require(devtools)
install_version("DBI", version = "0.5", repos = "http://cran.us.r-project.org")
install_version("RMySQL", version = "0.10.9", repos = "http://cran.us.r-project.org")

Error when trying install yii2-date-picker-widget

I am new in yii2 framework. When I am trying to install widget, getting error message. My command is here:
sudo composer require 2amigos/yii2-date-picker-widget:~1.0
And error is here:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package bower-asset/bootstrap-datepicker could not be found in any version, there may be a typo in the package name.
Problem 2
- 2amigos/yii2-date-picker-widget 1.0.x-dev requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.
- 2amigos/yii2-date-picker-widget 1.0.5 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.
- 2amigos/yii2-date-picker-widget 1.0.4 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.
- 2amigos/yii2-date-picker-widget 1.0.3 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.
- 2amigos/yii2-date-picker-widget 1.0.2 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.
- 2amigos/yii2-date-picker-widget 1.0.1 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.
- 2amigos/yii2-date-picker-widget 1.0.0 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.
- Installation request for 2amigos/yii2-date-picker-widget ~1.0 -> satisfiable by 2amigos/yii2-date-picker-widget[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.x-dev].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see https://getcomposer.org/doc/04-schema.md#minimum-stability for more details.
Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
Does anybody can help me? Appreciate every answer!
Have you tried to launch:
composer global require "fxp/composer-asset-plugin:~1.1.1"
STEP -1
Run this command on Terminal at Project main folder
---->curl -s http://getcomposer.org/installer | php
STEP -2
Successfully installation after run this command
--->php composer.phar require kartik-v/yii2-widget-datepicker "*"
you can see this contant in advanced->composer.json
"kartik-v/yii2-widget-datepicker": "*"
If you can't see this, means you missing some...
STEP -3
Define this library in views-> _form.php
use kartik\date\DatePicker;
STEP -4
And last define this given below code in your form at date field
<?= $form->field($model, 'xyz_field')->widget(DatePicker::ClassName(),
[
'name' => 'check_issue_date',
// 'value' => date('d-M-Y', strtotime('+2 days')),
'options' => ['placeholder' => 'Select issue date ...'],
'pluginOptions' => [
'format' => 'yyyy/dd/mm',
'todayHighlight' => true
]
]);?>

Using RMySQL interferes with RPostgreSQL

I have an R script where I want to pull some data from a MySQL database, then from a PostgreSQL database. However, loading the MySQL driver from RMySQL prevents me from loading the PostgreSQL driver from PostgreSQL.
I can load the Postgres driver fine on its own:
> RPostgreSQL::PostgreSQL()
<PostgreSQLDriver:(58810)>
Then I can load the RMySQL driver:
> RMySQL::MySQL()
<MySQLDriver>
However, if I load the MySQL driver first, the PostgreSQL driver fails to load:
> RMySQL::MySQL()
<MySQLDriver>
> RPostgreSQL::PostgreSQL()
Error in as.integer(from) :
cannot coerce type 'S4' to vector of type 'integer'
This seems a little magical to me: RMySQL shouldn't be altering functions in RPostgreSQL's namespace.
Does anyone have any idea what might be causing this problem and how I can solve it? I've replicated the problem on 2 different machines, with the exact same results.
Machine 1: Mac OS 10.9.5:
Machine R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] DBI_0.3.1 RMySQL_0.10 RPostgreSQL_0.41
Machine 2: Fedora release 20 (Heisenbug):
R version 3.1.1 (2014-07-10)
Platform: x86_64-redhat-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] DBI_0.3.1 RMySQL_0.10 RPostgreSQL_0.4
/edit: Furthermore, even if I load the Postgres driver first, merely loading the MySQL driver completely borks the Postgres driver:
library(DBI)
dr1 <- RPostgreSQL::PostgreSQL()
dr2 <- RMySQL::MySQL()
> dbConnect(dr1, host = "me", port = "1234", dbname = "me", user="me", password="me")
Error in as.integer(from) :
cannot coerce type 'S4' to vector of type 'integer'
/edit 2: This is a bug in RMySQL 0.10; the above code works fine in RMySQL 0.9.3. Judging from this 20-month old question, a similar bug crops up from time to time in RMySQL.