John Lande <john.land...@gmail.com> writes: > dear all, > > we am trying to improve the performance of my R code, with the implentation > of some function with custom C code. > we found difficult to import and export/import data structure such us > matrices or data.frame into the external C functions.
Please give a *very simple* example of what you're trying and failing to do. Use the .C() interface, forget about the .Call interface. Then it is not that hard. Start with the convolve example on p.69 and 70 of Writing R Extensions. Get that working and then turn it into your problem. Forget about lists and data frames: everything is going to be a simple vector. That includes arrays and matrices: you can pass them in, but C will know nothing about their dimensions until you tell it. Of course, you can pass the dimension vectors in as a separate vector. So, if you use arrays, you need to understand the order in which R stores the elements of the array. If your problem cannot be solved with the .C interface then you should consider whether it is worthwhile to proceed as the .Call interface repays those who use it frequently but has a considerably steeper learning (and forgetting) curve. Dan > > we already tried the solution from "Writing R Extensions" form the R > webpage. > > do you have any other solution or more advanced documentation on that point? > > looking forward your answer > > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.