Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sourcing scripts in [r] shows warnings since 2.15.1

Tags:

r

rstudio

I installed R (2.15.1) and RStudio (0.96.316) on a new mac. Now everytime I source an R-script I get the following warning message. No matter what the script looks like. In the next case I just used one cat('Hello World) argument.

> source('~/Documents/R-Files/skript.r')
Hello World

Warnmeldung:
In eval.with.vis(ei, envir) :
  .Internal(eval.with.vis) should not be used and will be removed soon

I get always the same amount of warnings as lines in my code. Having a script with four lines of input produces four warnings:

> source('~/Documents/R-Files/skript.r')
a Hello World
b Hello World
c Hello World
d Hello World

Warnmeldungen:
1: In eval.with.vis(ei, envir) :
  .Internal(eval.with.vis) should not be used and will be removed soon
2: In eval.with.vis(ei, envir) :
  .Internal(eval.with.vis) should not be used and will be removed soon
3: In eval.with.vis(ei, envir) :
  .Internal(eval.with.vis) should not be used and will be removed soon
4: In eval.with.vis(ei, envir) :
  .Internal(eval.with.vis) should not be used and will be removed soon

However, R-scripts work fine besides the warning messages.

I found the following information on R News:

  • source() now uses withVisible() rather than .Internal(eval.with.vis). This sometimes alters tracebacks slightly.

I think this is the reason for my problem, but I don't know the solution. How can I disable or avoid the warning?

like image 294
Bene Avatar asked Jul 20 '12 12:07

Bene


1 Answers

Debugging Example: "eval.with.vis" warning (this case XML library, your case, any library)

On my Mac after a 2.15.1 upgrade, I found the problem to be in the XML library by using binary search.

When I commented out this statement: library("XML") the warnings went away.

I traced this to the fact I was using a binary XML library from CRAN.

When I re-installed the library from the source (by using the R gui App menu selection "Packages and Data->Package Installer" and the using the left top drop down menu and selecting "CRAN (Sources)"), the R app rebuilt the library from source.

After this, the warnings were not longer present.

I suggest that you too determine which one of your libraries is using the "eval.with.vis" deprecated code, and then try re-compiling it from the source to make sure you have the latest version. If this doesn't work, you can change the source code itself to use the current version "withVisible".

I wasted three hours tracing this bug down.

If anyone knows of an automated way to re-install all the libraries, and then to manually find the ones that are causing the warnings, and then to semi-automatically re-install from source the offending libraries, that would be great.

Good luck all!

like image 148
Mike Avatar answered Oct 05 '22 12:10

Mike