[R] Problem with C extension

From: Markus Schmidberger <schmidb_at_ibe.med.uni-muenchen.de>
Date: Fri 19 Jan 2007 - 14:02:31 GMT


I try to write an extension in C, to get a faster functions. Therefore I have to add an element (vector) to a vector. The command in R is very simple: x = c(x,a)
But in C I have the problem to reallocate my vector for getting more space. Everything I tried, I get a "Segmentation fault".

So, how can I combine two vectors in C and give the result back to R (return(x))?

Markus Schmidberger

Dipl.-Tech. Math. Markus Schmidberger

Ludwig-Maximilians-Universität München
IBE - Institut für medizinische Informationsverarbeitung,
Biometrie und Epidemiologie
Marchioninistr. 15, D-81377 Muenchen
URL: http://ibe.web.med.uni-muenchen.de 
Mail: Markus.Schmidberger [at] ibe.med.uni-muenchen.de
Tel: +49 (089) 7095 - 4599

R-help@stat.math.ethz.ch mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sat Jan 20 01:12:38 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 19 Jan 2007 - 18:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.