Displaying 20 results from an estimated 1000 matches similar to: "Calling C Code from R"
2004 Nov 12
1
dyn.load problem
Hi R-Users
I wrote 1 week ago asking about a message that appears when I try run
dyn.load.
I'm trying to do an example in C code from "Writing R Extension" to
learn how to do it.
I have R 2.0.0, Rtools, Perl and MinGW as describe in
http://www.murdoch-sutherland.com/Rtools/ with path sets.
When I use C:\R\rw2000\bin>RCMD SHLIB -o C:/dev-cpp/teste.dll
2004 Nov 07
2
Problem with dyn.load()
Hi!
I am studying C language to run with R 2.0.0. My system (Windows ME /BR) is configured to run RCMD ( I have installed ActivePerl, Rtools and MinGW as indicated in http://www.murdoch-sutherland.com/Rtools/ an with correct path).
I would like run the coded write below named conv.c (Example from "Write R Extension") :
#include <R.h>
#include <Rinternals.h>
2007 Aug 23
1
.Call and to reclaim the memory by allocVector
Hi,
I am not sure if this is a bug and I apologize if it is something I
didn't read carefully in the R extension manual. My initial search on the
R help and R devel list archive didn't find useful information.
I am using .Call (as written in the R extension manual) for the C code
and have found that the .Call didn't release the memory claimed by
allocVector. Even after applying
2007 Aug 23
1
.Call and to reclaim the memory by allocVector
Hi,
I am not sure if this is a bug and I apologize if it is something I
didn't read carefully in the R extension manual. My initial search on the
R help and R devel list archive didn't find useful information.
I am using .Call (as written in the R extension manual) for the C code
and have found that the .Call didn't release the memory claimed by
allocVector. Even after applying
2004 Nov 29
1
data is getting corrupted
I've been attempting to perform some analysis on a model that was
interfaced with R (R calls a library that takes SEXPs and converts the
data frames into the internal structures of data), and I notice that for
small data.frames the vectors don't get corrupt (n<200-ish). When I pass
in larger data.frames, the vectors will become corrupt. I've been
PROTECTING the heck out of
2012 Dec 15
3
interfacing with .Call
Hi
My code is as following:
#include <R.h>
#include <Rinternals.h>
//* the Projector part *//
void Projector(double *L, int *dimL, double *G, int *dimG, double *W, int
*dimW, int *xymod, int *dimxy, double *modif, int *dimif, double *Lsum)
{ ...}
//* the interface part *//
#define getDim(A) INTEGER(coerceVector(getAttrib(A,R_DimSymbol), INTSXP))
SEXP Projector5(SEXP L, SEXP G,
2013 Apr 17
1
stack imbalance in max.col for non-real matrices
It's tough to reliably reproduce, but I often get stack imbalance warnings
when calling max.col() on non-real/double matrix. The code is conditionally
PROTECTing but not incrementing its nprot counter for the eventual
UNPROTECT. Pretty sure this would fix (but I haven't tested it):
Index: array.c
===================================================================
--- array.c (revision
2020 Feb 10
0
New DNS-Records not aviable
Funny you should post this now. I was just cleaning up some DNS records
and the following happend.
I had to PTR records with an empty timestamp. I deleted them and wanted
to recreate them.
My reverse Zones are
0.168.192.in-addr.arpa
and
2.168.192.in-addr.arpa
both of the records I delted were in the "0" zone.
The first i recreated with:
samba-tool dns add dc1
2009 Jul 23
1
dimension trouble for a matrix
Dear R People:
I'm having trouble with something that should be very simple.
I'm setting up a matrix outside of a loop and writing items into it
during the loop.
Here is the output:
> glob3b("sites.info")
dim 27 3
[1] "/raid1/osg-app"
Error in xy[i, ] : incorrect number of dimensions
Here is the function:
> glob3b
function(xx) {
x.df <-
2009 Sep 30
1
How to change e-mail address
Hi!
Thanks in advance.
I know this is not the right place to send this message. But I have tried to do so by sending e-mail to the addresses r-help-request@r-project.org and r-announce-request@stat.math.ethz.ch. But no success. I am getting messages such as "Your message to R-help awaits moderator approval".
I need your assistance on above.
I am an user of r-help. My e-mail
2004 Feb 18
0
return a list of vectors from C?
I've been working on a shared library that will be called from R. The
functions pass several vectors in and out (residuals, parameters, etc) and I
would like to be able to return a list of objects. I'm familiar with return
single objects (vectors, etc) from a C function, but need a little help for
returning a list of objects.
My code so far looks something like:
/* this function will
2004 Feb 18
0
return a list of vectors from C?
I've been working on a shared library that will be called from R. The
functions pass several vectors in and out (residuals, parameters, etc) and I
would like to be able to return a list of objects. I'm familiar with return
single objects (vectors, etc) from a C function, but need a little help for
returning a list of objects.
My code so far looks something like:
/* this function will
2008 Feb 07
2
a kinder view of Type III SS
A young colleague (Matthew Keller) who is an ardent fan of R is teaching me
much about R and discussions surrounding its use. He recently showed me
some of the sometimes heated discussions about Type I and Type III errors
that have taken place over the years on this listserve. I'm presumptive
enough to believe I might add a little clarity. I write this from the
perspective of someone old
2008 Oct 30
1
package pls
Hi,
For the package "pls", I need to understand the algorithm for
"simpls.fit" for Partial Least Squares. I'm not sure if simpls.fit tries
to find the weight vectors (loadings) to maximize which of the two:
Cov(Xw, y) or maximize Cov^2(Xw,y)? Are these objective functions
equivalent? (in some texts, they use the first and in other texts, they
use the second obj.
2006 Mar 15
1
(newbie) Weighted qqplot?
Folks,
Normally, in a data frame, one observation counts as one observation
of the distribution. Thus one can easily produce a CDF and (in Splus
atleast) use cdf.compare to compare the CDF (BTW: what is the R
equivalent of the SPlus cdf.compare() function, if any?)
However, if each point should not count equally, how can I weight the
points before comparing the distributions? I was thinking of
2017 Nov 24
0
number to volume weighted distribution
Hi Petr,
I think that Duncan suggests something like this:
x<- c(rep(10,20), rep(300,5), rep(100, 10))
tx <- table(x)
prop.x <- tx / sum(tx)
vx <- as.integer(names(tx))
prop.wx <- tx * vx / sum(tx * vx)
plot(ecdf(x))
plot(vx, cumsum(prop.x), ylim = 0:1)
plot(vx, cumsum(prop.wx), ylim = 0:1)
Best regards,
Thierry
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse
2017 Nov 24
2
number to volume weighted distribution
Hi Duncan
I tried Ecdf and/or wtd.quantile from Hmisc and it is working (probably).
Ecdf(x, q=.5)
Ecdf(x, weights=xw,col=2, add=T, q=.5)
wtd.quantile(x)
0% 25% 50% 75% 100%
10 10 10 100 300
wtd.quantile(x, weights=xw, type="i/n")
0% 25% 50% 75% 100%
10.0000 138.8667 192.5778 246.2889 300.0000
But could you please be more specific in this?
>
2011 Sep 01
0
qqplot for count data
Dear list,
I just tried to do the same thing, and did not find anything on a
weighted qqplot. My weights are actually counts (positive integers).
Here is a modification of qqplot, following Duncan Murdoch's
suggestion. Any feedback would be welcome!
Thanks,
Jean-Christophe
weighted.qqplot <- function (x, y,
plot.it = TRUE, xlab = deparse(substitute(x)),
ylab = deparse(substitute(y)),
2020 Feb 10
3
New DNS-Records not aviable
hi again.
after some tests, (on my operational domain and on a new testdomain) i
detected this behavior:
on samba 4.11.6 sometimes the new DNS-records finisches on a wrong dns
zone.
the problem occurs, if more then 5 records are created with the same
name in more then one domain zone
for example:
testa1.jupiter.mydom.org
testa2.jupiter.mydom.org
testa3.jupiter.mydom.org
2011 Oct 24
2
C function is wrong under Windows 7
Dear mailing list,
I have a C function that gives me a wrong result when I run it under Windows
7.
This is the code under Linux (RHEL5):
> library(phenoTest)
> data(epheno)
> sign <- sample(featureNames(epheno))[1:20]
> score <- getFc(epheno)[,1]
> head(score)
1007_s_at 1053_at 117_at 121_at 1255_g_at 1294_at
-1.183019 1.113544 1.186186 -1.034779 -1.044456