# A heart-shaped scatterplot
# Load highcharter library
library(highcharter)
# Generate heart-shaped data
<- seq(0, 2 * pi, by = 0.01)
t <- 16 * sin(t)^3
x <- 13 * cos(t) - 5 * cos(2 * t) - 2 * cos(3 * t) - cos(4 * t)
y
# Create our data frame
<- data.frame(x, y)
df
# Create highcharter plot
highchart(type = "chart") %>%
hc_add_series(data = df, type = "scatter", color = "red", marker = list(radius = 2)) %>%
hc_xAxis(min = -20, max = 20) %>%
hc_yAxis(min = -20, max = 15) %>%
hc_chart(backgroundColor = "transparent") %>%
hc_legend(enabled = FALSE)
About
About this site
Welcome to the EARN code library, a resource dedicated to the pursuit of economic and racial justice.
This library is intended to be a hub for generating and sharing research ideas, enhancing data analysis accessibility and transparency, and fostering collaboration.
On this site, you will find coding examples, commonly used EPI/EARN methodologies for economic analysis, coding resources, and beyond. Most importantly, user contributions are warmly welcomed!
User code submissions
Have a coding sample you would like to submit to the EARN code library? Contact dperez@epi.org
Components of a code library submission are:
Description
Code file(s)
Supplementary data
Output example
Author contact information