SAS® and R

Best of Both Worlds

Happy Mother’s Day

leave a comment »

happymotherday

Here is the R code for this graph.

par(bty='n', ann=FALSE, col.axis='white')
n=10000
r=0.7
r_e=(1-r*r)^.5
X=rnorm(n)
Y=X*r+r_e*rnorm(n)
Y=ifelse(X>0,Y,-Y)
a<-sample(c(2,5,6,7),n,T)
b<-sample(c(76,79,86,69),n,T)
plot(X,Y,col='green', axes=FALSE)
text(X,Y,"LOVE",col=a)
text(0, 0.6, "Happy\nMother's\nDay", adj=c(0.5, 0.5), col='white', cex=4)
Advertisements

Written by sasandr

May 12, 2012 at 8:57 pm

Posted in R

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: