On 11/24/2012 02:21 AM, skanap wrote:

Hi Jim,

Thank you for the reply. But, when I use Barpos I get this error.

plot(mydata$score,barpos)
Error in xy.coords(x, y, xlabel, ylabel, log) :
   'x' and 'y' lengths differ

I need all the points in x-axis that are in 'days' column. If I'm selecting
only points in val1 and val2 I'm missing rows for score.  Thanks again!

Hi SK,
If you want to get all bars and lines displayed, you can substitute zeros for the missing values in val1 and val2. Then your "empty bars" will have zero height and your "barpos" will have all the _x_ values you need. In the above you are using barpos as the _y_ values.

However, looking at Greg's solution, it is probably better in the general case of missing values.

Jim

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to