Displaying 2 results from an estimated 2 matches for "printlistelement".
2001 Oct 18
3
Rcmd SHLIB in rw1031 (R for Win)
...gt;Rcmd SHLIB e:/Rseg/test.c
dlltool -k --as as --dllname R.dll --def R.exp --output-lib libR.a
gcc -IE:/RW1031/src/include -include E:/RW1031/src/include/globalvar.h
-Wall
-O2 -c e:/Rseg/test.c -o e:/Rseg/test.o
e:/Rseg/test.c:78: warning: `/*' within comment
e:/Rseg/test.c: In function `printListElement':
e:/Rseg/test.c:15: warning: unused variable `prova2'
e:/Rseg/test.c:15: warning: unused variable `prova'
e:/Rseg/test.c:14: warning: unused variable `s3'
e:/Rseg/test.c:14: warning: unused variable `s2'
e:/Rseg/test.c:14: warning: unused variable `s1'
e:/Rseg/test.c:14: wa...
2001 Sep 27
1
Passing an R matrix to a C program
...atrix from R. I'm using .Call
because I've undertood that this is recommended
to handle lists (am I wrong?). My problem is that I
can pass the matrix as a vector, but not as a 2D array.
For example, in the following simple C program:
#include <R.h>
#include <Rdefines.h>
SEXP printListElement(SEXP list, SEXP stat)
{
SEXP elmt = R_NilValue, names = getAttrib(list, R_NamesSymbol);
int i; double g1, g2, g3, s1, s2, s3;
for (i = 0; i < length(list); i++) {
elmt = VECTOR_ELT(list, i);
g1 = REAL(VECTOR_ELT(list, i))[0];
s1 = REAL(stat)[12];
printf("%ld %f %f \n", i, g1, s1);...