From kohnicho@comp.nus.edu.sg  Sat Oct 27 16:19:53 2001
From: kohnicho@comp.nus.edu.sg (Nicholas Lewin-Koh)
Date: Sat, 27 Oct 2001 23:19:53 +0800 (GMT-8)
Subject: [Rd] Concatenating vectors in C (R API)
In-Reply-To: <Pine.LNX.4.21.0110271233010.26921-100000@artemis.imbe.med.uni-erlangen.de>
Message-ID: <Pine.GSO.4.21.0110272316180.26626-100000@sun450.comp.nus.edu.sg>

Hi,
I need to append one vector to another in C. I have this little test
program that crashes is this not what append is for? 

#include<R.h>
#include<Rinternals.h>

SEXP apt(SEXP a, SEXP b){

  SEXP ans;
  PROTECT(ans = append(a,b));
  UNPROTECT(1);
  return(ans);

}

Thanks

Nicholas









 

                 CH3
                  |
                  N             Nicholas Lewin-Koh
                 / \            Dept of Statistics
           N----C   C==O        Program in Ecology and Evolutionary Biology
          ||   ||   |           Iowa State University
          ||   ||   |           Ames, IA 50011
          CH    C   N--CH3      http://www.public.iastate.edu/~nlewin
            \  / \ /            nlewin@iastate.edu
             N    C
             |   ||             Currently
            CH3   O             Graphics Lab
                                School of Computing
                                National University of Singapore
     The Real Part of Coffee    kohnicho@comp.nus.edu.sg

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Concatenating vectors in C (R API)
Nicholas Lewin-Koh