When I call C function from Splus, I often meet this problem: "Problem: Couldn't find a function definition for "Stest" " My c function is saved as 'test.c' (the function is also named as 'test' My splus function is saved as 'Stest', such as Stest <- function(d,f) { .C("test", as.integer(d), as.single(f)) } Assume my files (test.c and Stest) have been stored in the directory ''work'' I have done the following steps in this directory: (1) Splus CHAPTER test.c (2) Splus make (3) Splus (4) d<-10 f<-rep(0,d) result<-Stest(d,f) then the error message is : Problem: Couldn't find a function definition for "Stest" What am I wrong??? Thank you for your help in advance!!!
Is there a question about R here? I haven't used S-PLUS in a long long time but it seems like you need to load your C function *before* you call it in S-PLUS. -roger _______________________________ UCLA Department of Statistics rpeng at stat.ucla.edu stat.ucla.edu/~rpeng On Wed, 5 Feb 2003, pingzhao wrote:> When I call C function from Splus, I often meet this problem: > "Problem: Couldn't find a function definition for "Stest" " > > My c function is saved as 'test.c' (the function is also named as 'test' > My splus function is saved as 'Stest', such as > > Stest <- > function(d,f) > { > .C("test", > as.integer(d), > as.single(f)) > } > > > Assume my files (test.c and Stest) have been stored in the directory ''work'' > I have done the following steps in this directory: > (1) Splus CHAPTER test.c > (2) Splus make > (3) Splus > (4) d<-10 > f<-rep(0,d) > result<-Stest(d,f) > > then the error message is : > Problem: Couldn't find a function definition for "Stest" > > What am I wrong??? > > Thank you for your help in advance!!! > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.math.ethz.ch/mailman/listinfo/r-help >