« In case you missed it: January 2013 Roundup | Main | Video: Data Mining with R »

February 14, 2013

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a010534b1db25970b017ee884c7ba970d

Listed below are links to weblogs that reference Make a Valentine's Heart with R:

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

For an alternate parameterization (with a more pointy bottom) see my Valentine to my spouse. I also include some math-geeky phrases of affection, such as "You are more beautiful than Euler's identity!"

Saw this great solution on Stackoverflow: http://stackoverflow.com/questions/8082429/plot-a-heart-in-r

```
dat<- data.frame(t=seq(0, 2*pi, by=0.1) )
xhrt <- function(t) 16*sin(t)^3
yhrt <- function(t) 13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)
dat$y=yhrt(dat$t)
dat$x=xhrt(dat$t)
plot(y ~ x, data=dat, type="l", bty="n", xaxt="n", yaxt="n", ann=FALSE)
with(dat, polygon(x,y, col="hotpink"))
points(c(10,-10, -15, 15), c(-10, -10, 10, 10), pch=169, font=5)
```

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment


R for the Enterprise

Got comments or suggestions for the blog editor?
Email David Smith.
Follow revodavid on Twitter Follow David on Twitter: @revodavid

Search Revolutions Blog