# y.nb.inter.tick: number of secondary ticks between main ticks on y-axis (only if not log scale). Zero means non secondary ticks
# tick.length: length of the ticks (1 means complete the distance between the plot region and the axis numbers, 0.5 means half the length, etc. 0 means no tick
# sec.tick.length: length of the secondary ticks (1 means complete the distance between the plot region and the axis numbers, 0.5 means half the length, etc., 0 for no ticks)
# text.corner: text to add at the top right corner of the window
# corner.text: text to add at the top right corner of the window
# amplif.legend: increase or decrease the size of the text of legend
# magnific.text.corner: increase or decrease the size of the text
# magnific.corner.text: increase or decrease the size of the text
# trim.return: return the trimmed and non trimmed values? NULL returned for trimmed and non trimmed values if trim.method == ""
tempo.cat<-paste0("\n\n================\n\nERROR IN fun_var_trim_display(): REQUIRED fun_param_check() FUNCTION IS MISSING IN THE R ENVIRONMENT\n\n================\n\n")
par(tcl=-par()$mgp[2]*tick.length)# tcl gives the length of the ticks as proportion of line text, knowing that mgp is in text lines. So the main ticks are a 0.5 of the distance of the axis numbers by default. The sign provides the side of the tick (negative for outside of the plot region)
if(is.null(displayed.nb)){
sampled.data<-as.vector(data)
if(text.corner==""){
text.corner<-paste0("ALL VALUES OF THE DATASET DISPLAYED")
if(corner.text==""){
corner.text<-paste0("ALL VALUES OF THE DATASET DISPLAYED")
}else{
text.corner<-paste0(text.corner,"\nALL VALUES OF THE DATASET DISPLAYED")
corner.text<-paste0(corner.text,"\nALL VALUES OF THE DATASET DISPLAYED")
text.corner<-paste0("BEWARE: ONLY ",displayed.nb," VALUES ARE DISPLAYED AMONG THE ",length(as.vector(data))," VALUES OF THE DATASET ANALYZED")
if(corner.text==""){
corner.text<-paste0("BEWARE: ONLY ",displayed.nb," VALUES ARE DISPLAYED AMONG THE ",length(as.vector(data))," VALUES OF THE DATASET ANALYZED")
}else{
text.corner<-paste0(text.corner,"\nBEWARE: ONLY ",displayed.nb," VALUES ARE DISPLAYED AMONG THE ",length(as.vector(data))," VALUES OF THE DATASET ANALYZED")
corner.text<-paste0(corner.text,"\nBEWARE: ONLY ",displayed.nb," VALUES ARE DISPLAYED AMONG THE ",length(as.vector(data))," VALUES OF THE DATASET ANALYZED")
}
}else{
sampled.data<-as.vector(data)
if(text.corner==""){
text.corner<-paste0("BEWARE: THE DISPLAYED NUMBER OF VALUES PARAMETER ",deparse(substitute(displayed.nb))," HAS BEEN SET TO ",displayed.nb," WHICH IS ABOVE THE NUMBER OF VALUES OF THE DATASET ANALYZED -> ALL VALUES DISPLAYED")
if(corner.text==""){
corner.text<-paste0("BEWARE: THE DISPLAYED NUMBER OF VALUES PARAMETER ",deparse(substitute(displayed.nb))," HAS BEEN SET TO ",displayed.nb," WHICH IS ABOVE THE NUMBER OF VALUES OF THE DATASET ANALYZED -> ALL VALUES DISPLAYED")
}else{
text.corner<-paste0(text.corner,"\nBEWARE: THE DISPLAYED NUMBER OF VALUES PARAMETER ",deparse(substitute(displayed.nb))," HAS BEEN SET TO ",displayed.nb," WHICH IS ABOVE THE NUMBER OF VALUES OF THE DATASET ANALYZED -> ALL VALUES DISPLAYED")
corner.text<-paste0(corner.text,"\nBEWARE: THE DISPLAYED NUMBER OF VALUES PARAMETER ",deparse(substitute(displayed.nb))," HAS BEEN SET TO ",displayed.nb," WHICH IS ABOVE THE NUMBER OF VALUES OF THE DATASET ANALYZED -> ALL VALUES DISPLAYED")
y.text<-(par("usr")[4]+((par("usr")[4]-par("usr")[3])/(par("plt")[4]-par("plt")[3]))*(1-par("plt")[4])+((par("usr")[4]-par("usr")[3])/((par()$omd[4]/2)*((par("plt")[4]-par("plt")[3]))))*(1-par("omd")[4]))# BEWARE. Here in "(par()$omd[4] / 2", division by two because there are 2 graphs staked on the y axis, and not one
par(xpd=NA)
text(x=x.text,y=y.text,paste0(text.corner),adj=c(1,1.1),cex=magnific.text.corner)# text at the topright corner
text(x=x.text,y=y.text,paste0(corner.text),adj=c(1,1.1),cex=magnific.corner.text)# text at the topright corner