if (interactive()) {
vega_data <- import_vega_data()
plot_basic <-
alt$Chart(vega_data$cars())$
encode(
x = "Miles_per_Gallon:Q",
y = "Horsepower:Q",
color = "Origin:N"
)$
mark_point()
plot_basic
}
Run the code above in your browser using DataLab