cancel
Showing results for 
Search instead for 
Did you mean: 

Error while using R algorithm in Expert Analytics 2.4

Former Member
0 Kudos

Using the Expert Analytics module in SAP Predictive Analytics I've encountered a an issue while executing my model. I'm using the builtin R Algorithm R-CNR Tree and when the execution gets to that point it throws an error (which is in the image below).

I used Expert Analytics' option for installing and configuring R.

My SAP PA version is 2.4.0

And the R version installed by PA is 3.2.1

Does anyone knows how to solve this issue?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, have exactly the same problem in the same configuration (PA 2.4, R 3.2.1, default instal) running R CNR Tree. Actually do face slightly different error message as per screenshot attached. Apparently there is a package missing.

I have already tried to to update the packages but with no success. Any idea how I can install the package 'pbkrtest' mentioned in the error message?

Thanks a lot

Radovan

abdel_dadouche
Active Contributor
0 Kudos

HI,

I had to manually install this one as it is not part of the "default" packages. Matrix was also missing from the default packages.

if you need help to manually install a R package just let me know as there several ways.

After it was ok, but I haven't tested all the R algorights available in Expert.

Regards

Abdel

Former Member
0 Kudos

Thanks for coming back so quickly... Indeed I would need an advice how to install the package. Frankly I am not a R person at all, so ideally the simplest way would be the best .

Brgds

Radovan

Former Member
0 Kudos

Hi Radovan,

An SAP note will be released shortly for this issue that has resulted from a recent update to pbkrtest package. The authors of this package have removed support for the version of R required by Expert Analytics (R 3.2.1) and therefore it is not downloaded from within Expert Analytics for first time R installations. More details can be found on their release notes: https://cran.r-project.org/web/packages/pbkrtest/index.html

The workaround is to download 0.4-4 version of pbkrtest package that works with R 3.2.1 and install it manually following the steps below:

  1. Download the supported version of pbkrtest from: https://cran.r-project.org/src/contrib/Archive/pbkrtest/pbkrtest_0.4-4.tar.gz to a local folder, for      example, C:\temp\
  2. Launch R Studio and run the install command with full path to where you downloaded the package; for example,

    install.packages("C:\\temp\\pbkrtest_0.4-4.tar.gz", repos=NULL, type="source").

         Note: The double quotes may need to be retyped when copy-pasting if they are converted into rich text characters.

Let us know how you get on.

Regards,

Jayant

Former Member
0 Kudos

Thanks, did the download and run the command with results as follows:

> install.packages("C:\\temp\\pbkrtest_0.4-4.tar.gz", repos=NULL, type="source")

ERROR: dependency 'MASS' is not available for package 'pbkrtest'

* removing 'C:/Users/Public/R-3.2.1/library/pbkrtest'

Warning messages:

1: running command '"C:/Users/Public/R-3.2.1/bin/x64/R" CMD INSTALL -l "C:\Users\Public\R-3.2.1\library" "C:/temp/pbkrtest_0.4-4.tar.gz"' had status 1

2: In install.packages("C:\\temp\\pbkrtest_0.4-4.tar.gz", repos = NULL,  :

  installation of package ‘C:/temp/pbkrtest_0.4-4.tar.gz’ had non-zero exit status

>

Apparently there was a problem... Now after configuring the tree paramaters I get immediatelly an error as attached...

So it gets even worse now...

Many thanks

Radovan

abdel_dadouche
Active Contributor
0 Kudos

HI,

i will be off today to give you detailed step to install it.

it seems that one of the pbkrtest dependency is missing. This is probably due to a misconfigured CRAN

let me get back to you next week with some screenshot to fix this.

abdel

Former Member
0 Kudos

I did check back in the file system and apparently the package is completely missing now. The install routine did successfully uninstall it before (failing) to instal the downloaded one...

Thanks a lot

Radovan

abdel_dadouche
Active Contributor
0 Kudos

here is something I quickly wrote to help solve this issue with pbkrtest:

Let me know if that was helpful

@bdel

Former Member
0 Kudos

Thanks, did this on my office machine and now the tree works.. Wonder whether the same works on m home machine, where I did manage to uninstall the package completely..

Many thanks and brgds

Radovan

Former Member
0 Kudos

Hi

so Im back. Trying to replicate on my home machine, I run into problems. The log I get is as follows:

C:\Users\navod>"C:/Users/Public/R-3.2.1/bin/x64/R" CMD INSTALL -l "C:\Users\Public\R-3.2.1\library" "C:\temp\pbkrtest_0.4-4.tar.gz"

* installing *source* package 'pbkrtest' ...

** package 'pbkrtest' successfully unpacked and MD5 sums checked

** R

** data

** inst

** preparing package for lazy loading

Warning: package 'lme4' was built under R version 3.2.3

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :

  namespace 'nlme' 3.1-120 is being loaded, but >= 3.1.123 is required

Error : package 'lme4' could not be loaded

ERROR: lazy loading failed for package 'pbkrtest'

* removing 'C:/Users/Public/R-3.2.1/library/pbkrtest'

I have tried to reinstal R from the PA linked distribution, but the resut is the same...

Thanks a lot for advice

Radovan

abdel_dadouche
Active Contributor
0 Kudos

Hi,

This is weird. lme4 is part of the standard packages installed.

I will update the trouble shooting doc, but my guess is that when you uninstalled R on this machine, you did clean the library directory located in C:/Users/Public/R-3.2.1.

Can you try to run the following command from the R studio:

     install.packages("lme4")

This should give you the following output:

     trying URL 'http://cran.irsn.fr/bin/windows/contrib/3.2/lme4_1.1-11.zip'

     Content type 'application/zip' length 4746682 bytes (4.5 MB)

     downloaded 4.5 MB

     package ‘lme4’ successfully unpacked and MD5 sums checked

     The downloaded binary packages are in

             C:\Users\i304811\AppData\Local\Temp\Rtmp2xL4SS\downloaded_packages

Then run the following from a DOS prompt:

     "C:/Users/Public/R-3.2.1/bin/x64/R" CMD INSTALL -l "C:\Users\Public\R-3.2.1\library" "C:\Users\i304811\AppData\Local\Temp\Rtmp2xL4SS\downloaded_packages\lme4_1.1-11.zip"

Regards

Abdel

Former Member
0 Kudos

Abdel, thank you very much! I had the same issue as Radovan and this worked like a charm! I will mark this as the correct answer! I believe it could be great if you could add a small section to your post with this info it would be of great use for a lot of people!

Thanks for your time!

abdel_dadouche
Active Contributor
0 Kudos

Thanks for your feedback!

Blog updated!

Feel free to like, bookmark and share the document!

Former Member
0 Kudos

Hi,

I did as follows:

R::::::

>   install.packages("lme4")
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://cran.irsn.fr/bin/windows/contrib/3.2/lme4_1.1-11.zip'
Content type 'application/zip' length 4747061 bytes (4.5 MB)
downloaded 4.5 MB

package ‘lme4’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\navod\AppData\Local\Temp\Rtmpot7atH\downloaded_packages
>

DOS:::: (had to modify path to the downloaded package)

C:\Users\navod>     "C:/Users/Public/R-3.2.1/bin/x64/R" CMD INSTALL -l "C:\Users\Public\R-3.2.1\library" "C:\Users\navod\AppData\Local\Temp\Rtmpot7atH\downloaded_packages\lme4_1.1-11.zip"

package 'lme4' successfully unpacked and MD5 sums checked

R::::

> require ("car")

Loading required package: car

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :

  there is no package called ‘pbkrtest’

In addition: Warning message:

package ‘car’ was built under R version 3.2.3

> install.packages("pbkrtest")

Warning message:

package ‘pbkrtest’ is not available (for R version 3.2.1)

DOS::::

C:\Users\navod>"C:/Users/Public/R-3.2.1/bin/x64/R" CMD INSTALL -l "C:\Users\Public\R-3.2.1\library" "C:\temp\pbkrtest_0.4-4.tar.gz"

* installing *source* package 'pbkrtest' ...

** package 'pbkrtest' successfully unpacked and MD5 sums checked

** R

** data

** inst

** preparing package for lazy loading

Warning: package 'lme4' was built under R version 3.2.4

** help

*** installing help indices

** building package indices

** installing vignettes

** testing if installed package can be loaded

Warning: package 'lme4' was built under R version 3.2.4

* DONE (pbkrtest)

R::::

> require ("car")

Loading required package: car

Warning message:

package ‘car’ was built under R version 3.2.3

And now the tree works... Tough I have to admit its tricky to really achieve this. I now 2 of my colleagues facign huge issues as well will have to track back whether I can resolve their problems with what I have learned and eventually come back again.

Thanks a lot

Radovan

abdel_dadouche
Active Contributor
0 Kudos

Hi,

Glad this solved your issue.

Feel free to get back to us if you experience any new issues.

Regards

@bdel

Answers (4)

Answers (4)

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Jonathan, is your problem resolved thanks to Abdel's tips?

Best regards

Antoine

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi, I just noticed a support ticket raised today on the same topic - was this raised by any of you 2 ?(Jonathan or Radovan) 


Incident 190223 / 2016 / Error with R in Expert Analytics

Thanks & regards,

Antoine

Former Member
0 Kudos

Not me...

Former Member
0 Kudos

Hi! I raised that support ticket, I've been in contact since thursday with SAP Support team, but still having this issue.

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thanks Jonathan, can you please share the detail here as well? Have you been able to refer to Abdel's post?

Best regards

Antoine

Former Member
0 Kudos

Hi! Yes I checked Abdel's post but I had the same issue as Radovan. Abdel's latest answer solved my problem, I'm marking it as a correct answer!

abdel_dadouche
Active Contributor
0 Kudos

Hi,

I think you have a little glitch in your R installation.

I recently found out that with a fresh install of PA 2.4 and using the "Install R" link from the Expert menu, was not properly working.

I also found this article with your error message:

     http://stackoverflow.com/questions/23958161/object-not-found-error-when-loading-party-package-i... which makes me think that the CRAN that you used for the install did not work properly.

can you try to run the following command from the R prompt:

     update.packages(checkBuilt=TRUE)

I also had to manually install some packages manually required by the Expert part.

Let me know if you need some help for this.

@bdel

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thanks Abdel, regarding the PA 2.4 and install R link, my experience was not the same as I was able to properly install it on some of my machines.

Best regards

Antoine

abdel_dadouche
Active Contributor
0 Kudos

Hi,

It may work well but that depends on the CRAN you are using and where you are located.

I tried it many times from the office (4 floor above you) and it never worked on a clean desktop (uninstalled every PA & R installs).

I think we should build a "Troubleshooting your R install guide" with some of the commonly seen issues.

Regards

@bdel

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Indeed.Adding for awareness.

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi, it is difficult to judge from the error message. Is it an option you can share the Expert Analytics file?

Thanks & regards

Antoine

Former Member
0 Kudos

Sorry!

I tried to upload the file it but the forum won't allow due to its size (2.9MB), but I can provide the log files from Expert Analytics.

Let me know if this of any help.

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

I read the logs but goes not extra clues. is it an option for you to raise a support ticket? are you looking for classification ? if yes, you could give a try to Automated Analytics capabilities?

Thanks & regards

Antoine

Former Member
0 Kudos

Actually Automated Analytics doesn't meet my needs as I also want to include some custom R algorithms. But thanks for the advice. I will raise a support ticket and see.

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Sounds good Jonathan. Can I flag this as "Assumed answered" as the next interactions will be via the support channel? Thanks and regards Antoine