Hi i want do a line graph. My y axis contains numeric values. My x axis contains non numeric statements. This is what i want the graph to look like. When i try to plot this graph on R it comes up with the following error message: "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" Any help would be much appreciated. Thanks in advance. -- View this message in context: http://n4.nabble.com/Plotting-numeric-values-against-non-numeric-items-tp1010129p1010129.html Sent from the R help mailing list archive at Nabble.com.
On 01/09/2010 12:38 PM, lse1986 wrote:> Hi i want do a line graph. > > My y axis contains numeric values. My x axis contains non numeric > statements. > > This is what i want the graph to look like. > > When i try to plot this graph on R it comes up with the following error > message: > > "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" > >Hi Sam, While I don't know what you want the graph to look like, I would suggest the following: xf<-factor(x) plot(as.numeric(xf),rnorm(10),type="l",xaxt="n") axis(1,at=1:10,labels=xf) Jim
Check out the interaction.plot function. On Fri, 8 Jan 2010, lse1986 wrote: l > l > Hi i want do a line graph. l > l > My y axis contains numeric values. My x axis contains non numeric l > statements. l > l > This is what i want the graph to look like. l > l > When i try to plot this graph on R it comes up with the following error l > message: l > l > "Error in plot.window(...) : need finite 'xlim' values l > In addition: Warning messages: l > 1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion l > 2: In min(x) : no non-missing arguments to min; returning Inf l > 3: In max(x) : no non-missing arguments to max; returning -Inf" l > l > Any help would be much appreciated. Thanks in advance.