Skip to content

Instantly share code, notes, and snippets.

@agricolamz
Created January 4, 2020 20:52
Show Gist options
  • Save agricolamz/1761f3b3a18d5bc5afba7fe392bcf1e1 to your computer and use it in GitHub Desktop.
Save agricolamz/1761f3b3a18d5bc5afba7fe392bcf1e1 to your computer and use it in GitHub Desktop.
```{r}
library(r2d3)
df <- data.frame(x = rnorm(20), y = rlnorm(20))
df <- round(df*10)+100
```
```{d3 data = df}
svg.selectAll('circle')
.data(data)
.enter()
.append('circle')
.attr("cx", function(d) {return d.x;})
.attr("cy", function(d) {return d.y;})
.attr("r", 5);
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment