0

I would like to know how in R I could plot the lines between the x and y points (which ultimately draw multiple rectangles) using the data source supplied.

Obviously, I'm an R newbie.

Thanks. T

...here's a sample of the data im working with;

98424.510138591315,71935.284654243747,99034.509345822924,71934.301202769013,99034.106291939825,71684.301527674092,98424.107084708216,71685.284979148826,98424.510138591315,71935.284654243747,T0101
99067.509302935461,71934.247999656451,99677.50851016707,71933.264548181716,99677.105456283971,71683.2648730868,99067.106249052362,71684.248324561529,99067.509302935461,71934.247999656451,T0102
99710.508467279607,71933.211345069139,100320.50767451122,71932.2278935944,100320.10462062812,71682.228218499484,99710.105413396508,71683.211669974218,99710.508467279607,71933.211345069139,T0103
100353.50763162374,71932.174690481828,100963.50683885536,71931.1912390071,100963.10378497226,71681.191563912173,100353.10457774064,71682.1750153869,100353.50763162374,71932.174690481828,T0104
100996.50679596789,71931.138035894532,101606.50600319951,71930.154584419783,101606.10294931641,71680.154909324861,100996.10374208479,71681.13836079961,100996.50679596789,71931.138035894532,T0105
101639.50596031203,71930.10138130722,102249.50516754364,71929.117929832486,102249.10211366054,71679.118254737565,101639.10290642893,71680.1017062123,101639.50596031203,71930.10138130722,T0106
102282.50512465618,71929.064726719909,102892.50433188779,71928.081275245175,102892.10127800469,71678.081600150254,102282.10207077308,71679.065051624988,102282.50512465618,71929.064726719909,T0107
98423.858803516239,71531.285179290353,99033.858010747848,71530.301727815619,99033.454956864764,71280.3020527207,98423.455749633154,71281.285504195432,98423.858803516239,71531.285179290353,T0201
99066.857967860386,71530.248524703056,99676.857175092,71529.265073228322,99676.45412120891,71279.2653981334,99066.4549139773,71280.248849608135,99066.857967860386,71530.248524703056,T0202
99709.857132204532,71529.211870115745,100319.85633943614,71528.228418641011,100319.45328555306,71278.228743546089,99709.454078321447,71279.212195020824,99709.857132204532,71529.211870115745,T0203
100352.85629654866,71528.175215528434,100962.85550378029,71527.1917640537,100962.4524498972,71277.192088958778,100352.45324266558,71278.175540433513,100352.85629654866,71528.175215528434,T0204
100995.85546089281,71527.138560941137,101605.85466812443,71526.155109466388,101605.45161424135,71276.155434371467,100995.45240700972,71277.138885846216,100995.85546089281,71527.138560941137,T0205
NelsonGon
  • 13,015
  • 7
  • 27
  • 57
Trevor H
  • 35
  • 3
  • 1
    Please read your data as a `csv` file and post its `dput`. See more [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – NelsonGon Jun 12 '19 at 06:29

1 Answers1

0

You can use geom_segment from ggplot2. An example:

library(ggplot2)

df <- data.frame(x = c(1,2), y = c(1,1), xend = c(2,1), yend = c(2,1))
ggplot(df) + geom_segment(aes(x = x, y = y, xend = xend, yend = yend))

This draws two lines. One from P(1/1) to P(2/2), the other from P(1/1) to P(2/1).

enter image description here

Hope this helps.

symbolrush
  • 7,123
  • 1
  • 39
  • 67