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).
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 (execute query here).
#defaultView:Dimensions
SELECT ?a ?b {
VALUES (?a ?b) {
("string1" 20)
("string2" 15)
("string3" 10)
("string4" 19)
}
}
Data
dat <- structure(list(labels = c("string4", "string3", "string2", "string1"
), quantity = c(19L, 10L, 15L, 20L)), row.names = 4:1, class = "data.frame")