R programming language

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
outstripp
Posts: 9
Joined: Fri Dec 05, 2008 4:32 am

R programming language

Post by outstripp » Fri Jul 09, 2010 6:00 am

Has anyone played with a Rev interface for the R programming environment--especially for doing statistics?
How about displaying R graphics in Rev?

It is trivial to put something like this in a field:

Code: Select all

r --vanilla
license()
demo(lm.glm)
xvar=c(10,20,30,40,50)
xvar
demo(graphics)
q()
and then run it in a shell(fld 1) command. But the graphics are lost.

Steve
outstripp

outstripp
Posts: 9
Joined: Fri Dec 05, 2008 4:32 am

Re: R programming language

Post by outstripp » Fri Jul 09, 2010 8:44 am

To answer my own question

Code: Select all

xvar=c(10,20,30,40,50,44,55,66,33,44)
mean(xvar)
yvar=c(2,2,3,8,9,3,4,8,6,7)
mean(yvar)
#plot a regression line
png(file="myplot.png")
#par(mfrow=c(2,2))	#put 4 graphs in one frame
plot(xvar,yvar)
abline(lm(yvar~xvar))
dev.off()
q()
and then in Rev:

Code: Select all

import paint from file "myplot.png"
It's cool.
outstripp

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: R programming language

Post by Mark » Fri Jul 09, 2010 9:00 am

Hi Steve,

In my opinion it is cooler to have R generate the statistics (where relevant) and have Revolution generate the graphs. I think that Revolution has more graphing features.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jorgebarrero
Posts: 1
Joined: Sun Aug 24, 2014 2:43 pm

Re: R programming language

Post by jorgebarrero » Sun Aug 24, 2014 2:45 pm

Hello

I am very interested in this topic... can you tell me what have you acomplished?

Post Reply