Displaying 20 results from an estimated 2000 matches similar to: "Interfacing R and C++ under Windows"
2002 Sep 16
2
how to fit just a fixed effects model?
Dear all,
How can one fit just a fixed effects model in R? lme() seems to require a random component, whereas I am just looking for something like STATA's "xtreg, fe" function.
Thanks,
Pijus
----
W: 212-588-7897
F: 212-446-1955
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2003 Feb 10
3
non-SQL sqlQuery error
Dear all,
I've encountered a curious problem. I am trying to run an SQL query
using sqlQuery() function in RODBC.
The query works fine when run in a stand-alone SQL browser (Microsoft
Query Analyzer, in particular).
However, when I use the exact same thing from sqlQuery() function, I get
the following error:
Error in "[.data.frame"(data, , ) : not all specified columns exist
2007 Aug 15
1
getting lapply() to work for a new class
Hi,
I would like to get lapply() to work in the natural way on a class I've
defined. As far as I can tell, lapply() needs the class to be coercible
to a list. Even after I define as.list() and as.vector(x, mode="list")
methods, though, I still get an "Error in as.vector(x, "list") : cannot
coerce to vector". What am I doing wrong?
# dummy class
2002 Aug 28
1
handling dates in R
Dear all,
I am just getting into R, and I arrive with a task in hand. I need to handle time series of price data, and use them in regressions and cluster models of various kinds. At this time, I am just trying to learn the most graceful ways of working with date-indexed data in R in general.
I know of the ts object; however, it seems to assume a very regular periodicity of the data.
2002 Dec 12
1
improving ts object
Dear all,
Currently, a ts object behaves like an array, and it would be very useful to have a similar object, which would behave like a data.frame, i.e. it could be indexed, named, etc. like a data.frame. What would be the most efficient way to construct such an object? I have tried to make one on my own following the directions of class design from "S Programming" (2000) as a
2013 May 24
1
Problem with Rboolean in c++ code
I am trying to use R_RegisterCFinalizerEx to ensure some c++ object is
properly deleted after use. However, I run into some problems when
trying to pass in the third argument which is an Rboolean. The line
'R_RegisterCFinalizerEx(p, finalizer, TRUE);' generates the following
error when trying to compile using R CMD SHLIB:
g++ -I/usr/share/R/include -DNDEBUG -fpic -O2 -pipe
2008 Mar 15
1
Experimental R_has_slot() utility
Dear list,
The utility "R_has_slot" mentioned in the file NEWS
("Experimental R_has_slot() utility supplementing R_do_slot()")
appears to be missing from a fresh checkout of the development branch.
$ svn up
At revision 44759.
$ grep -i has_slot `find include -name '*.h'`
$ grep -i _slot `find include -name '*.h'`
include/Rdefines.h:#define GET_SLOT(x, what)
2025 Mar 25
2
Patch for RJSONIO
I can never remember where the canonical sources are for the effectively-CRAN
maintained packages so I am dropping it here -- yesterday's update to RJSONIO
does not build on anything older than r-devel. This patch helps, feel free
to adjust as needed.
Dirk
diff -ru RJSONIO.orig/src/RJSON.c RJSONIO/src/RJSON.c
--- RJSONIO.orig/src/RJSON.c 2025-03-24 02:10:08.000000000 -0500
+++
2008 Mar 20
1
Rmpi and C Code, where to get the communicator
Hello,
I try to write parts of my code in C to accelerate the for-loops. But
basic operations I want to do in R (e.g. start cluster). My R code looks
something like this:
library(Rmpi)
mpi.spawn.Rslaves()
mpi.remote.exec(....)
dyn.load("test.so")
erg <- .Call("test", ....)
....
mpi.close.Rslaves()
mpi.quit()
And my C function looks something like this:
#include
2004 Feb 11
1
About the macro defined in Rinternals.h
Hello everyone,
I try to write a c++ code which calls embedded R and uses some of R
internal functions. What I read is just lots of macro names defined in
the Rinternals.h or Rdefines like R_Parse, Rf_install and so on. But
where can I get the detailed information about the parameters of these
macro? For example, what about the parameters of SEXP
R_ParseVector(SEXP, int, ParseStatus *)?
2005 Aug 20
1
Implementing a single-precision class with raw
A package that I develop (xcms) sometimes needs to read and process
vectors several hundreds of megabytes in size. (They only represent
parts of a large data sets which can approach nearly 100GB.)
Unfortunately, R sometimes hits the 2GB memory limit of Win32. To help
cut the memory footprint in half, I'm implementing a "float" class as a
subclass of "raw". Because
2001 Sep 10
1
problems linking c++ code
I've been trying to learn about dynamically loading subroutines in R.
Ultimately I would like to use this approach to implement some
simulations. For the moment though, I've run into a problem compiling
c++ code and loading it into R.
The 'C/C++' and 'R'code below works fine when compiled and linked with
gcc, but gives an error when the library is compiled and linked with
2004 Feb 17
2
interfacing C++ using .Call
Hi folks,
I apologise if this is in the documentation somewhere, but I can't
seem to find it. I also did a search of CRAN without any success. I'm
using R-1.8.1 (pre-compiled) on Windows 2000 with Rtools and mingw 2.0.0
(which includes gcc/g++ 3.2).
I'm trying to link some C++ code from another application to R using the
.Call interface and am experiencing some problems. I was
2009 Sep 16
2
I want to get a reference to this time series object
I'm trying to get a reference to this object in C
SWX.RET[1:6,c("SBI,"SPI","SII")]
While i am able to access and use a plain SWX.RET object, I'm getting
confused on how to create an object with the array subscripts like above.
Here is what I tried to do. It doesn't work because "[" is obviously not an
operation or function on SWX.RET. So how do I
2006 Nov 15
1
Feature request: put NewEnvironment and R_NewhashedEnv into API
Hi,
I would like to be able to create new environments from package C
code. AFAICT, this isn't allowed since both NewEnvironment and
R_NewHashedEnv are declared in Defn.R.
If exposing this isn't controvertial, I would submit a patch.
However, I'm not sure where the declarations should go (Rdefines.h?)
and whether they need to change to Rf_*.
+ seth
2005 Dec 21
1
linking C and R
hey,
I am running R 2.0.1 on a the terminal of my MAC OS X and I have written some C code that I would like to use dynload to bring into R. When I try to compile the code i get the error R.defines.h no such file or directory. I know that the file is in resources/include but where do I have to move the file to so that the compiler can access it? I tried copying Rdefines.h and R_ext folders
2010 Jun 18
3
C interface
Greetings,
I am trying to call simple C-code from R.
I am on Windows XP with RTools installed.
The C-function is
#include <R.h>
#include <Rinternals.h>
#include <Rmath.h>
#include <Rdefines.h>
// prevent name mangling
extern "C" {
SEXP __cdecl test(SEXP s){
SEXP result;
PROTECT(result = NEW_NUMERIC(1));
double* ptr=NUMERIC_POINTER(result);
double t =
2010 Oct 08
1
R CMD SHLIB changes function name when compiling
Hi,
I'm trying to write a function in C for implementation with .Call. When
compiling using R CMD SHLIB characters seem to be added to the function
name.
Here's the complete C code from the file summariseMCMC.c:
#include<R.h>
#include<Rdefines.h>
#include<Rinternals.h>
void summariseMCMC(SEXP data) {
PROTECT(data=AS_NUMERIC(data));
UNPROTECT(1);
}
Then
2003 Oct 31
2
How to grow an R object from C (.Call Interface)
What is the best way to grow an R return object in writing a C function
using the Rdefines.h macros.
In my application, the final size of the return object is not known during
construction. My understanding is that each time I grow an R object I have to
use PROTECT() again, probably before UNPROTECTing the smaller version.
However, due to the stack character of the PROTECT mechanism, UNPROTECT
2006 Apr 12
0
headerfile translation to Delphi (Pascal) completed
Hi,
I am happy to announce that I finished the translation of almost all
LGPL'ed R headerfiles to Delphi. As a test I did several demos which
basically contain delphized versions of all the examples of chapter 5
in "Writing R Extensions".
Please have a look in the attachments for details
(DemosAndHeaders.txt), more information (Readme.txt) and an example of
how it looks