Home > Enterprise >  R function for plotting labels and quantitative data in two vertical lines, lines are drawn between
R function for plotting labels and quantitative data in two vertical lines, lines are drawn between

Time:07-28

The question

Given this data

labels,quantity
string1,20
string2,15
string3,10
string4,19

I want to create the following graph in R: Two parallel vertical lines, the one on the left for the labels and the one for the right for the quantitative data. Lines are drawn between the pairs (see image below).

enter image description here

Is there a function in some R package that can create such plots? If not, could you provide some information on how I could do it?

Additional context

The graph shown above was generated by Wikidata by using the following SPARQL query (enter image description here

It is worth adding that echarts4r creates html charts - whether that is a benefit or not depends. You can save it to png using htmlwidgets as described here.

  • Related