Displaying 20 results from an estimated 2000 matches similar to: "Plot and curve inside C++"
2009 Sep 29
3
How do I access class slots from C?
Hi
I'm trying to implement something similar to the following R snippet using
C. I seem to have hit the wall on accessing class slots using C.
library(fPortfolio)
lppData <- 100 * LPP2005.RET[, 1:6]
ewSpec <- portfolioSpec()
nAssets <- ncol(lppData)
setWeights(ewSpec) <- rep(1/nAssets, times = nAssets)
ewPortfolio <- feasiblePortfolio(
data = lppData,
spec = ewSpec,
2012 Mar 01
1
mb_m buffer not cleared if parseEval fails
Hi,
I am using RInside for one of the applications that I'm using. The error
that occured is as follows.
When I use R.parseEval("xyz") if the parse fails then the mb_m is not
cleared and hence all subsequent
calls to R.parseEval fail.
example:
when R.parseEval("stringConcatfactoryrandom") is executed the R instance
looks like this
(gdb) p R
$7 = (RInside &)
2010 Sep 28
1
How to convert SEXP to double
Hello All,
A simple question.
I get some return from the R in my C++ program (via Rcpp package). The
result come, as SEXP and it should be a simple numeric variable.
How to convert it to double?
The code, what i use:
stringstream ss;
ss << "p <- predict(fit_ar11, n.ahead = 2, doplot=FALSE);"
<< "p$pred[1]";
SEXP ans;
int iRet =
2025 Apr 02
1
R y c++ en Mac
Estimados
Se me puso en la cabeza, hacer algo en C++ que ejecute un código R, nada complicado, experimentación.
Al respecto hay por ejemplo:
#include <RInside.h>
int main(int argc, char *argv[]) {
RInside R(argc, argv); // Inicializa R
// Ejecutar una expresión R
R.parseEvalQ("resultado <- sqrt(16)");
// Obtener resultados desde R
double
2025 Apr 03
1
R y c++ en Mac
Buenas,
No utilizo xcode, pero todos los compiladores tienen opciones para modificar la ruta de los encabezado y las librerías.
Si no necesita librerías para compilar puede copiar el fichero de cabecera en la carpeta del programa o poner la ruta completa al fichero y
cambiar los ángulos por comillas.
Un saludo.
El mié, 02-04-2025 a las 18:06 -0300, Javier Marcuzzi escribió:
> Estimados
>
2014 Oct 22
1
Problems to compile examples of RInside
Hello,
I have some problems to migrate to R >3.0 my devel machine (R.2.15.2). So I decided to start from scratch with a brand new virtual machine.
Downloaded latest network install of debian testing, not stable (jessie/sid, SMP Debian 3.16.3-2 (2014-09-20) x86_64 GNU/Linux) installed only with ssh-server and basic utilities (no X).
Then I installed R by:
apt-get install
2013 Sep 27
1
LENGTH function causing name conflict
I am attempting to bring R-3.0.2 functionality into a project with a very
large C++ codebase. The existing codebase already has a LENGTH function
defined. R also defines a LENGTH function.
I first compiled R as a shared library and linked it into this existing
codebase, along with RInside. When I run a parseEvalQ with a linear model
command it will stack dump. Looking at the backtrace, what is
2011 Jan 26
2
Dealing with R list objects in C/C++
Hi,
I'd like to construct an R list object in C++, fill it with relevant data, and pass it to an R function which will return a different list object back. I have browsed through all the R manuals, and examples under tests/Embedding, but can't figure out the correct way. Below is my code snippet:
#include <Rinternals.h>
// Rf_initEmbeddedR and other setups already performed
2017 May 09
3
R-3.3.3/R-3.4.0 change in sys.call(sys.parent())
Some formula methods for S3 generic functions use the idiom
returnValue$call <- sys.call(sys.parent())
to show how to recreate the returned object or to use as a label on a
plot. It is often followed by
returnValue$call[[1]] <- quote(myName)
E.g., I see it in packages "latticeExtra" and "leaps", and I suspect it
used in "lattice" as well.
This idiom
2017 May 11
1
R-3.3.3/R-3.4.0 change in sys.call(sys.parent())
Here is a case where the current scheme fails:
> with(datasets::mtcars, xyplot(mpg~wt|gear)$call)
xyplot(substitute(expr), data, enclos = parent.frame())
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, May 11, 2017 at 1:09 AM, Deepayan Sarkar <deepayan.sarkar at gmail.com>
wrote:
> On Wed, May 10, 2017 at 2:36 AM, William Dunlap via R-devel
> <r-devel at
2015 Jan 23
2
LDA input validation
Hi,
I'm using qmail + dspam + dovecot-lda.
A typical .qmail file :
| /usr/bin/dspam --client --deliver=stdout --user "$EXT@$USER" | /usr/bin/preline -f /usr/lib/dovecot/dovecot-lda -d "$EXT@$USER" -a "$EXT@$USER" -m "$EXT2"
When dspam segfault or is killed, preline receive an empty content and only pass to dovecot-lda two headers ( Return-Path and
2008 Dec 14
2
Help required to install package from a website
Hi,
I am new to R and I'm looking to perform some method comparison
analysis and would be grateful for some help regarding package
installation.
There is a package 'MethComp' that I want to use
(http://staff.pubhealth.ku.dk/~bxc/MethComp/Courses/Sthm.2007/.)
Unfortunately I am unable to install it. I have tried numerous
approaches but to no avail. this is the first time I have tried to
2011 Sep 13
1
solving linear equations
I have a dataset
X Y1
1200 1.375
4000 0.464
1333.33 0.148
444.44 0.047
148.148 0.014
49.383 0.005
16.461 0.004
I have to find a curve fit for the above dataset based on a 4-parameter
logistic equation viz.
Y1 = d + ((a-d)/(1+(X/cc)^b)), where X and Y1 are the values above.
I need to know how to solve the above equation for values a, b, c, d.
--
View this message in context:
2010 Apr 30
2
RInside & child threads
Hi Folks,
I am creating a multi-threaded C++ application that initializes RInside in
one of the child thread.
I would also like to access support interfaces like Rcpp::Environment in the
remaining child threads, so that I could access any "R" function associated
with the
environment initialized.
When I run my program, I always get "C Stack limit too huge" errors.
I looked
2015 Dec 11
1
Runtime error when run a RInside program compiled by intel c++ on windows
I have intstalled R-3.2.2,Rcpp-0.12.2,RInside-0.2.13 on windows. I compiled the example1 of RInside in the
example directory which create a RInside instance and prints "hello world". The compiler is intel c++. I included
the RInside source files in the project and fixed the compile and link errors. But when run the executable file it
prints some error message and quites.
I debug
2010 Nov 22
1
Using RInside in Visual Studio 8.0 VC++.NET Program
Hello,
I am trying to use Rinside package in my VC++.Net program ( using Visual
Studio 8.0 environment). I have downloaded Windows binary of RInside from
the following link
http://cran.r-project.org/web/packages/RInside/index.htm
Version of RInside - 0.2.3
While compiling the program , i am getting about 69 error. Some of them are
the folllowing ones. Please me in solving the following issue
2012 Dec 05
1
RInside, rcpp compilation problem
I have spent some hours browsing the RInside and rcpp documentation, lots of it; but ... as a programmer of C++ since 1990, on both Windows and Unix ... ( Solaris and Ubuntu, and Mandrake/Mandrivo Linux); I see a minor problem ...... Where is the rcpp.h header file?? The below code fails to compile as the RInside.h header file references the rcpp.h header file, which is not included with
2009 May 20
4
Functions returning functions
Dear All:
I have a question regarding the behavior of functions.
Say I define a function that returns another function :
A <- function(parameters) {
# calculations w/ parameters returning 'y'
tmpf <- function(x) { # function of 'y' }
return(tmpf)
}
The value of the parameters are stored in an environment local to the
function. Then I call
x<- something
2019 Dec 03
2
Account locked and delayed user data propagation...
Mandi! Rowland penny via samba
In chel di` si favelave...
I came back on this, because still some glitches happen.
Yesterday I'm locked out.
'pdbedit -vL gaio' say me that account IS locked. But:
> yes, Provided you use the right attribute to search on ;-)
> Something like this will give you if/when the account was locked out:
> ldbsearch -H
2007 Nov 25
1
Package Building under Windows with MikTeX 2.6
Dear WizaRds,
I wrote a small function in R and would like to create a package. The
necessary documentation is done, Rtools etc. are installed and I am
still unable to complete the process under Windows. I did extensive
research in the archives and read the Murdoch-Sutherland website on the
Rtools and MikTeX hints. I realize that I understand only half or less
of what is said there