View source: R/plot_3_by_distance.R
plot_3_by_distance | R Documentation |
create plot of 3 indicators versus distance This makes a very simple scatter plot of 3 variables on y axis as a function of distance on the x axis. For example, it can show risk, percent demographic score, and population density, e.g., using numbers created at random by sim_riskbydistance()
plot_3_by_distance(
x,
xname = "dist",
xlab = "Distance (miles)",
ynames = c("risk", "pctd", "popdensity"),
mylegend = c("Risk", "% Demog", "Pop density"),
mycolors = c("red", "orange", "blue")
)
x |
data.frame such as output from |
xname |
colname in x so that x,xname can be used as x values in plot |
xlab |
like in plot(), a string label for x axis |
ynames |
3 colnames in x, with 3 sets of y values for the scatter plot, but they have to be in the same units for the plot to make sense, so they could be percentages, or percentiles, for example. |
mylegend |
3 strings to use in legend(legend=mylegend, fill=mycolors) |
mycolors |
3 colors for legend |
sim_riskbydistance()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.