TestHistogram_A  is a function that plots a histogram,  then returns 3.  For
me it fails 

to display the plot, at least in the order given below.

 

TestHistogram_B is a function that plots a histogram, then exits.   The only
difference between

the 2 functions is that B does not return 3.   It displays the plot.

 

This problem does not occur when histogram is replaced by boxplot

 

Their use is in the following statements:

 

Data <- c(1,1,1,2,2)

Data <- data.frame(Data)

TestHistogram_A <- function (my.data) { histogram(my.data[,1],main="TEST");
3}

TestHistogram_A(Data)

TestHistogram_B <- function (my.data) { histogram(my.data[,1],main="TEST") }

TestHistogram_B(Data)

 


	[[alternative HTML version deleted]]

