This post is dedicated to all the R programming lovers. It's not easy to impress tech-savvy valentine with conventional surprises.You might have tried all conventional surprises for your valentine. If your valentine is R programming lover, you can have an impact on her with your cool coding skill.
How to Use
Ask your valentine to run the following R program and see what you mean
Method 1 : Heart Curve
Method 2 : Text Message
Don't tell your valentine what the program returns and make it a surprise.
Wish Valentine with R |
How to Use
Ask your valentine to run the following R program and see what you mean
Method 1 : Heart Curve
# Enter the name of person you love
mylove = "Katie"
# Load ggplot2 package
library(ggplot2)
# Create data frame
k = seq(0, 2*pi, pi/60)
mydata = data.frame(
x = 16*sin(k)^3 +25,
y = 13*cos(k) - 5*cos(2*k) - 2*cos(3*k) - cos(4*k) +20
)
# Generate Plot
Valentine = ggplot(data = mydata, aes(x, y)) +
geom_polygon(aes(group = 1), fill = "red") +
geom_text(aes(x = 25, y = 20, label = "Happy Valentine's Day!"),
size = 8, colour = "white") +
geom_text(aes(x = 15, y = 5, label = paste("To :", mylove)),
size = 5, colour = "#444444")
Valentine
Method 2 : Text Message
paste(intToUtf8(acos(log(1))*180/pi-17),
intToUtf8(atan(1/sqrt(3))*180/pi+2), toupper(substr(month.name[4],5,5)),
intToUtf8(acos(exp(0)/2)*180/pi+2^4+3),toupper(substr(month.name[11],3,3)),
LETTERS[3^2-2^2],intToUtf8(atan(1/sqrt(3))*180/pi+2),
intToUtf8(acos(log(1))*180/pi-1), substr(month.name[10],1,1),
intToUtf8(acos(log(1))*180/pi-5), sep = intToUtf8(0))
Don't tell your valentine what the program returns and make it a surprise.
Output |
Amazing...
ReplyDeleteThank you for your appreciation.
Deletegetting an error
ReplyDeleteError in UseMethod("weekdays") :
no applicable method for 'weekdays' applied to an object of class "c('double', 'numeric')"
It seems R version issue. I have updated the code. It should work now. Thanks!
Deleteit doesn't work for me :(
ReplyDeleteIt seems R version issue. I have updated the code. It should work now. Thanks!
DeleteI can't run it. I have next error:
ReplyDeleteError in UseMethod("weekdays") :
no applicable method for 'weekdays' applied to an object of class "c('double', 'numeric')"
It seems R version issue. I have updated the code. It should work now. Thanks!
DeleteIt works now. Thank you!
DeleteAwesome. It is working for me. Yipeee :-)
ReplyDeletestill doesn't work
ReplyDeleteUpdated the code. It should work now. See the snapshot of the output. I apologize for the inconvenience caused. Please confirm if it still does not work.
Deletedoesn't work, even with the new code
ReplyDeleteUpdated the code. It should work now. See the snapshot of the output. I apologize for the inconvenience caused. Please confirm if it still does not work.
Deletethanks!!! My girlfriend loved it!!!
ReplyDeleteAwesome. It served its purpose!
DeleteAll because of "I LOVE YOU" ? Anyway, it's interesting, but what if my crush is not using R? Well done.
ReplyDeleteThe way to print those characters one by one using code conversion. I liked it.
ReplyDeletethank you very much. very funny program.
ReplyDeleteSo romantic!
ReplyDeleteit will certainly work in R-fiddle
ReplyDeleteThank you, very cool; how can I customize it to add the name of a specific person?
ReplyDelete