r - Correct parameters for the geom_line layer in ggplot2 -


i have dataframe such:

1   pos    77 2   neg    58 3   pos make    44 4   neg make    34 5   pos movi    154 6   neg movi    145     ... 20  neg    45 

i produce plot using geom_text layer in ggplot2.

i have used code

q <- ggplot(my_data_set, aes(x=value, y=value, label=variable))  q <- q + geom_text() q 

which produced plot:

enter image description here

obviously, not ideal plot.

i produce plot similar, except have positive class on x-axis, , negative class on y-axis.

update: here example of attempting emulate:

enter image description here

i can't seem figure out correct way give arguments geom_line layer.

what correct way plot value of positive arguments on x-axis, , value of negative arguments on y-axis, given data frame have?

thanks attention.

my_data_set <- read.table(text = " id variable value pos    77 neg    58 pos make    44 neg make    34 pos movi    154 neg movi    145", header = t)  library(data.table) my_data_set <- as.data.frame(data.table(my_data_set)[, list(                       y = value[id == "neg"],                       x = value[id == "pos"]),                = variable])  library(ggplot2) q <- ggplot(my_data_set, aes(x=x, y=y, label=variable))  q <- q + geom_text() q 

enter image description here


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -