🌹 Spread the 💜 for R 📦 with valentine::roses()

valentine is a small R packages that uses ChatGPT via the openai package to generate roses are red … poetry about R packages.
package
valentine
poetry
ai
love
Author
Affiliation

Romain François

Published

February 14, 2024

To get ready, at least in the R world 😝, for Valentine’s day, I’ve cooked a little R 📦 to spread the love by generating Roses are Red, … poems about packages using ChatGPT though the openai package.

You can install it with pak::pak("tadascience/valentine") and perhaps it will be released to CRAN in time for Valentine’s day, it’s in the pipeline.

If you are not already set with an OPENAI_API_KEY, see you later in this article, otherwise let’s make some 🤖 poetry 🪶 📝

valentine::roses("tidyverse")
🌹 Roses are red, 📦
✨ tidyverse is my love, 💕
💡 It makes coding fun, 🤩
🌈 With tidy data, I rise above! 📊

You can tweak the prompt that is sent with the hint= argument.

valentine::roses("lubridate", hint = "make it kinky")
Roses are red 🌹
Lubridate keeps time in your bed 🕒💤
Date parsing and manipulation so fine 😍💃
It's the R package that sparks a kinky line! 🔥😉

Before you can use valentine::roses() you need to be setup with an API key you can get from OpenAI. Once you’re there, click the “Create new secret key”, name it whatever you like:

And then copy the secret key.

… and store it in your .Renviron file, e.g. by using usethis::edit_r_environ()

Restart R, and 🦆

valentine::roses("data.table")
Roses are 🔴, 
Data.table is 💪,
Efficient and 🚀,
It's a 🎁 to me!