Re: [R] Error when producing multiple graphes

From: Uli Kleinwechter <ulikleinwechter_at_yahoo.com.mx>
Date: Wed, 19 Mar 2008 13:21:24 +0100

I just solved the problem. The error happened because of the empty variables in the dataframe.

In any case, thanks for caring.  

bartjoosen schrieb:
> Could you provide us some working codo, so that we can reproduce the error
> and see what went wrong?
>
>
> Uli Kleinwechter wrote:
>
>> Dear all,
>>
>> Within a larger script I use the following code to produce barplots for
>> all variables contained in a dataframe "type3m":
>>
>> for(xn in names(type3m)) barplot(table(type3m[[xn]]), main = paste
>> ("Barplot of", xn), width=0.75,legend.text=barnamesm,
>> xlim=c(0,4),ylim=c(0,400))
>>
>> The plots are produced and printed into a *.ps file. However, R gives an
>> error message and aborts the script. The error message is:
>>
>> Fehler in rect(as.double(xleft), as.double(ybottom),
>> as.double(xright), :
>> ung├╝ltiges erstes Argument
>>
>> (it's in German. In English, it says something like "Error in
>> rect(as.double(xleft), as.double(ybottom), as.double(xright), : invalid
>> first argument)
>>
>> It seems to be some problem with the barplot function. The variables in
>> the dataframe are discrete variables taking values from 1 to 4 (hence,
>> the xlim=c(0,4) and the graph is supposed to show the frequency of each
>> value. Maybe the problem is related to the fact that not some variables
>> don't take all of the values, i.e., there are some that don't take the
>> value 1, for example.
>>
>> I spent quite some time trying to solve the problem, but can't manage
>> it. What's wrong here and how can it be solved?
>>
>> Thank you very much!
>>
>> Uli
>>
>>
>> [[alternative HTML version deleted]]
>>
>>
>> ______________________________________________
>> R-help_at_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.
>>
>>
>>
>
>



R-help_at_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. Received on Wed 19 Mar 2008 - 12:23:31 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 19 Mar 2008 - 13:30:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive