Created
December 12, 2012 21:06
-
-
Save shabbychef/4271636 to your computer and use it in GitHub Desktop.
demonstrate R and octave 'magics' in ipython.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to get the R<->python magic | |
%load_ext rmagic | |
# now you can code in R: | |
%%R | |
library(survival) | |
amod <- coxph(Surv(lung$time,lung$status) ~ lung$sex + lung$ph.karno) | |
print(summary(amod)) | |
# done | |
# to get the octave<->python magic | |
%load_ext octavemagic | |
%%octave | |
x = randn(100,20) | |
y = sum(x,1) | |
# done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment