0

I have managed to get my data results in this format:

     month   Result
 1 11/2017 98.66667
 2 12/2017 97.78947
 3 01/2018 96.13636
 4 02/2018 96.40000
 5 03/2018 94.00000
 6 04/2018 97.92857
 7 05/2018 95.75000

I am now trying to plot this as a line graph:

plot(month, Result, type="l")

but am getting the below error:

Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf
Jaap
  • 81,064
  • 34
  • 182
  • 193
pablo144
  • 117
  • 2
  • 8
  • 2
    Your month variable is stored either as a character or a factor. You need to transform it into a Date class. There are many questions on SO that address this conversion. – lmo Jun 03 '18 at 14:11
  • There is a ton of posts with the same error message in their title. Have you read any of them? [this one](https://stackoverflow.com/questions/21349368/error-in-plot-window-need-finite-xlim-values) and [this one](https://stackoverflow.com/questions/33520535/r-error-in-plot-window-need-finite-xlim-values). Please do a little internet searching prior to posting a question. – lmo Jun 03 '18 at 14:15
  • this post http://grokbase.com/t/r/r-help/127z5wzka8/r-time-series-line-plot-error-in-plot-window-invalid-xlim-value on grokbase is nearly identical. – lmo Jun 03 '18 at 14:17

0 Answers0