My decision to focus on the C programming language as my first real attempt to learn programming has some rational thought behind it. I'd like to create functions that can be used to manipulate, twist, distort and skew data. The R programming language and statistical platform is actually well-suited for data mining expeditions, except that I overheard some "quote" - programmers - complain that it has some problems with memory and speed. Please, who cares. It's always something.
Well, though I like to gratuitously ignore complainers, I listen with one ear just in case. There may be something there, but there is also a solution. Pass the function duties to a C program, because everyone knows that C is the fastest in the universe when it comes to running programs. C is compiled (that means it can get scrunchy) and it has a very close relationship to assembly language, which is what actually talks to silicon chips.
Okay, we know what must be done. Create a C program to do the heavy lifting of an R session. To do this, you need to create an R package (and you thought C pointers where confusing). Once you create an R package, you put your turbo-charged C program into a pre-defined directory, compile it, and then that's it. Ask a professional "programmer" about this process and you'll get the "read the manual" response because their time is so important they can't be bothered. Plus, they're really smart too. Left to your own devices, you must learn on your own. This is my method.
I've posted links below to various PDF and text files I found through google searching. I've printed the files (anywhere from 3 to 16 pages) and then drove down to the local mail/fax/print shop to have them bind it for about $3.00. Now, I have my own book about how to learn some strange things.
Using .Call in R
Calling C functions from R using .C and .Call
Calling C Functions From R
Calling C and Fortran from R
An Introduction to the R package Mechanism
R Functions: Writing, Using and Documenting
An Introduction to the .C Interface to R
Calling C Code from R this one is a text file
Due to the sausage-making nature of this learning method, you will likely find quite a bit of repetition in these articles. But that is also the point of iterating until convergence. You keep returning to your 6:00 am wakeup call and repeat the day until you get it right.
4 comments: