checkForLegLoc: Find best place on plot for placing legend
Description
This function tries to find the best location for placing a legend of a bivariate plot, ie scatter-plot.
All 4 corners of the data to plot are inspected for the least occupation by data plotted while displaying the content of sampleGrp.
Alternatively, by setting the argument showLegend the user-defined legend will be returned
(character or factor) with this option the text to be displayed in the legend may be taken into consideration for its length
showLegend
(logical or character) decide if matr should be checked for best location; if showLegend contains any of the standard legend-location designations (eg 'topleft') it will be used in the output
suplSpace
(numeric) allows to consider extra room taken in legend by symbol and surrounding space, interpreted as n additional characters
testCorner
(integer) which corners should be considered (1=left-top, 2=right-top, right-bottom, left-bottom)
silent
(logical) suppress messages
callFrom
(character) allow easier tracking of message(s) produced
Value
list with $showL indicating if legend is desired and $loc for the proposition of the best location, $nConflicts gives the counts of conflicts