[Rd] Concatenating vectors in C (R API)

Nicholas Lewin-Koh kohnicho@comp.nus.edu.sg
Sat, 27 Oct 2001 23:19:53 +0800 (GMT-8)


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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._