lecture_09

lecture_09 - The Interface between R and C Q.Chad He...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
The Interface between R and C Q.Chad He Department of Biostatistics University of North Carolina at Chapel Hill Sep 20, 2011 Interface
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Outline Motivation A brief introduction to C An example to call C in R Some other issues Interface
Background image of page 2
Why to call C in R? R is nice, but can be slow, especially when many loops are involved. A real example: for (j in 1:1000000){ simulate-my-data (y, X) my-novel-stat-method (y, X, my-statistics) } Time! Time! Time! Interface
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What is C? A question from an EPI professor A general-purpose programming language developed in 1970’s Fast: support the use of Pointers, and can directly manage memory use Many different compilers: we often use the Microsoft Visual Studio Interface
Background image of page 4
A toy example of C program #include <stdio.h> int main(){ cout«"I don’t like this class!"; } You can write your own function and header file. Interface
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
C can be very frustrating to use!
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 13

lecture_09 - The Interface between R and C Q.Chad He...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online