Yes,it works !
What's the reason for it?


Many thanks!






--
QQ: 1733768559





At 2014-04-15 14:36:41,"Jim Lemon" <jim@bitwrit.com.au> wrote:
>On 04/15/2014 11:46 AM, meng wrote:
>> Hi all:
>> I met a question about the output of plot.
>> I want to output 3 plots.
>> Method1: by function histogram{lattice}
>> Method2: by function hist{graphics}
>>
>>
>> But method1 failed(the output is empty),and only method 2 works.
>> I can't find out the reason,and many thanks for your help.
>>
>>
>> #Method1---failed(the output is empty)
>> library(lattice)
>> for(i in 1:3)
>> {
>> x<-rnorm(10)
>>
>>
>> jpeg(paste("e:\\hist_",i,".jpeg"))
>> histogram(x)
>> dev.off()
>> }
>>
>>
>>
>>
>> #Method 2---works
>> for(i in 1:3)
>> {
>> x<-rnorm(10)
>>
>>
>> jpeg(paste("e:\\hist_",i,".jpeg"))
>> hist(x)
>> dev.off()
>> }
>>
>Hi meng,
>Try:
>
>print(histogram(x))
>
>Jim
>

	[[alternative HTML version deleted]]

