Skip to content

[Rcpp-devel] Execution Error

5 messages · John Robson, Dirk Eddelbuettel

#
Hello everyone,

My RInside was working before, but stopped to work after some updates (I
think so).

With Qt:

Starting
/home/note/projects/qt/qtdensity-build-desktop-Qt_4_8_2_in_PATH__System__Release/qtdensity...
Error in plot.density(density(y, bw = bw/100, kernel = kernel), xlim =
range(y) +  :
  unused arguments (xlim = range(y) + c(-2, 2), main = "Kernel: gaussian")
terminate called after throwing an instance of 'std::runtime_error'
  what():  Error evaluating:
svg(width=6,height=6,pointsize=10,filename=tfile); plot(density(y,
bw=bw/100, kernel=kernel), xlim=range(y)+c(-2,2), main="Kernel:
gaussian"); points(y, rep(0, length(y)), pch=16, col=rgb(0,0,0,1/4));
dev.off()
The program has unexpectedly finished.
/home/note/projects/qt/qtdensity-build-desktop-Qt_4_8_2_in_PATH__System__Release/qtdensity
exited with code 0

With WT:

[error] "Wt: fatal error: Error evaluating:
png(filename=tfile,width=600,height=400); plot(density(y, bw=bw/100,
kernel=kernel), xlim=range(y)+c(-2,2), main=""Kernel: gaussian"");
points(y, rep(0, length(y)), pch=16, col=rgb(0,0,0,1/4));  dev.off()"

My Info:

R version 3.1.0 (2014-04-10)

514K Mar 29 18:55 /usr/local/lib/R/site-library/RInside/libs/RInside.so
/usr/local/lib/R/site-library/RInside/libs/RInside.so

514K Mar 29 18:55 /usr/local/lib/R/site-library/RInside/lib/libRInside.so

Thank you,
#
On 7 May 2014 at 23:49, John Robson wrote:
| My RInside was working before, but stopped to work after some updates (I
| think so).
| 
| With Qt:
[...]
| The program has unexpectedly finished.
| /home/note/projects/qt/qtdensity-build-desktop-Qt_4_8_2_in_PATH__System__Release/qtdensity
| exited with code 0

Confirmed -- but it went away as soon as _reinstalled_ RInside.

RInside and Rcpp have a pretty tight toughling so you are best off to
reinstall whenever you see something like this.

I fully expect the Wt issue to be identical.

Dirk
#
On 8 May 2014 at 05:25, Dirk Eddelbuettel wrote:
|
| On 7 May 2014 at 23:49, John Robson wrote:
| | My RInside was working before, but stopped to work after some updates (I
| | think so).
| | 
| | With Qt:
| [...]
| | The program has unexpectedly finished.
| | /home/note/projects/qt/qtdensity-build-desktop-Qt_4_8_2_in_PATH__System__Release/qtdensity
| | exited with code 0
| 
| Confirmed -- but it went away as soon as _reinstalled_ RInside.
| 
| RInside and Rcpp have a pretty tight toughling so you are best off to

"have a pretty tight coupling" is what I meant to type. Sorry.

Anyway, message still holds: reinstall RInside against the Rcpp you now have,
rebuild example, it should run.  

Dirk

| reinstall whenever you see something like this.
| 
| I fully expect the Wt issue to be identical.
| 
| Dirk
| 
| -- 
| Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
#
Thank you Dirk, you are right.

I did this:
$ sudo R
All the packages were compiled:
"g++ -I/usr/share/R/include -DNDEBUG     -I. -fpic  -O2 -pipe -g  -c"

And now works perfectly in Qt and Wt !!!

Two questions:

1) these steps works; but this is the correct approach?

2) to use Rcpp and RInside I must install only through R?  Or I can 
compile in the linux terminal and install them? (make and make install)

Thank you very much,
John
On Thu May 8 08:34:27 2014, Dirk Eddelbuettel wrote:
#
On 8 May 2014 at 12:13, John Robson wrote:
| Thank you Dirk, you are right.
| 
| I did this:
| $ sudo R
| > remove.packages("RInside", lib=file.path("/usr/local/lib/R/site-library"))
| > remove.packages("Rcpp", lib=file.path("/usr/lib/R/site-library"))
| > install.packages(c("Rcpp", "RInside"), type="source", dependencies=TRUE)
| 
| All the packages were compiled:
| "g++ -I/usr/share/R/include -DNDEBUG     -I. -fpic  -O2 -pipe -g  -c"
| 
| And now works perfectly in Qt and Wt !!!
| 
| Two questions:
| 
| 1) these steps works; but this is the correct approach?
| 
| 2) to use Rcpp and RInside I must install only through R?  Or I can 
| compile in the linux terminal and install them? (make and make install)

This is a bit off-topic but as I have meant to write this up on a web page
somewhere and haven't yet here it goes: I use two scripts out of littler (a
package on Github, and in Debian/Ubuntu) _all_ _the_ _time_ because I like to
just launch builds / upgrades on a command prompt and keep my R prompt free
for actual work.

With that, you also do not need to uninstall first.  

Current versions of these scripts are at 

   https://github.com/eddelbuettel/littler/blob/master/examples/install.r

   https://github.com/eddelbuettel/littler/blob/master/examples/update.r

which I just sync'ed to what I currently use (eg RStudio's CDN as the CRAN
mirror as it is consistently very fast).

So I'd just say    'install.r RInside'   and it would fetch, build and
(re-)install that package.  You can specify more than one etc pp. 

Hth,  Dirk