# pdf: logical. Use pdf display? If FALSE, a GUI is opened
# pdf.path: where the pdf is saved (do not terminate by / or \\). Write "working.dir" if working directory is required (default). Ignored if pdf == FALSE
# pdf.name: name of the pdf file containing the graphs (the .pdf extension is added by the function, if not detected in the name end). Ignored if pdf == FALSE
# width: width of the window (in inches)
# height: height of the window (in inches)
# paper: paper argument of the pdf function (paper format). Only used for pdf(). Either "a4", "letter", "legal", "us", "executive", "a4r", "USr" or "special". If "special", means that the paper dimension will be width and height. With another paper format, if width or height is over the size of the paper, width or height will be modified such that the plot is adjusted to the paper dimension (see $dim in the returned list below to see the modified dimensions). Ignored if pdf == FALSE
# pdf.overwrite: logical. Existing pdf can be overwritten? . Ignored if pdf == FALSE
# rescale: kind of GUI. Either "R", "fit", or "fixed". Ignored on Mac and Linux OS. See ?windows for details
# remove.read.only: logical. remove the read only (R.O.) graphical parameters? If TRUE, the graphical parameters are returned without the R.O. parameters. The returned $ini.par list can be used to set the par() of a new graphical device. If FALSE, graphical parameters are returned with the R.O. parameters, which provides information like text dimension (see ?par() ). The returned $ini.par list can be used to set the par() of a new graphical device, but generate a warning message. Ignored if return.output == FALSE.
# return.output: logical. Return output ? If TRUE the output list is displayed
# RETURN
...
...
@@ -3619,6 +3620,7 @@ tempo <- fun_check(data = width, class = "vector", mode = "numeric", length = 1,
tempo.cat <- "\n\n================\n\nERROR IN fun_open()\nTHIS FUNCTION CANNOT OPEN GUI ON LINUX OR NON MACOS UNIX SYSTEM (X GRAPHIC INTERFACE HAS TO BE SET)\nTO OVERCOME THIS, PLEASE SET pdf ARGUMENT TO TRUE AND RERUN\n\n================\n\n"
# provide correct justification for axis labeling, depending on the chosen angle
# ARGUMENTS
# angle: integer value of the text angle for the axis labels. Positive values for counterclockwise rotation: 0 for horizontal, 90 for vertical, 180 for upside down etc. Negative values for clockwise rotation: 0 for horizontal, -90 for vertical, -180 for upside down etc.
# angle: integer value of the text angle for the axis labels, using the same rules as in ggplot2. Positive values for counterclockwise rotation: 0 for horizontal, 90 for vertical, 180 for upside down etc. Negative values for clockwise rotation: 0 for horizontal, -90 for vertical, -180 for upside down etc.
fun_gg_scatter(data1=obs1,x="Km",y="Time",color="black")# replace "black" by 2 to test integer values
# Using one color value par class of Categ1
fun_gg_scatter(
data1=obs1,
x="Km",
y="Time",
categ="Car",# mandatory categ argument when several color required
color=c("darkblue","darkgreen")# replace c("darkblue", "darkgreen") by 2:3 to test integer values
)
# Using a vector of color values (e.g., data frame column), with respect of the correspondence between Car and Color1 columns
fun_gg_scatter(
data1=obs1,
x="Km",
y="Time",
categ="Car",# mandatory categ argument when several color required
color=obs1$Color1# # replace obs1$Color1 by as.numeric(obs1$Color1) to test integer values
)
### multiple datasets
# single color -> same color for all the datasets and all the classes of categ if non NULL
fun_gg_scatter(
data1=list(
L1=obs2,
L2=obs3
),
x=list(
L1="Km",
L2="Distance"
),
y=list(
L1="Time",
L2="Time_lapse"
),
categ=list(# mandatory categ argument when several color required per dataset
L1="Animal",
L2="Beast"
),
color="darkblue"# replace "darkblue" by 2 to test integer values
)
# list of single colors -> each dataset with the same color
fun_gg_scatter(
data1=list(
L1=obs2,
L2=obs3
),
x=list(
L1="Km",
L2="Distance"
),
y=list(
L1="Time",
L2="Time_lapse"
),
categ=list(# mandatory categ argument when several color required per dataset
L1="Animal",
L2="Beast"
),
color=list(
L1="darkblue",# replace "darkblue" by 2 to test integer values
L2="darkgreen"# replace "darkgreen" by 3 to test integer values
)
)
# list of single colors for each class of the categ argument
fun_gg_scatter(
data1=list(
L1=obs2,
L2=obs3
),
x=list(
L1="Km",
L2="Distance"
),
y=list(
L1="Time",
L2="Time_lapse"
),
categ=list(# mandatory categ argument when several color required per dataset
L1="Animal",
L2="Beast"
),
color=list(
L1=c("darkblue","darkred"),# replace c("darkblue", "darkred") by 2:3 to test integer values
L2=c("darkgreen","darkorange")# replace c("darkgreen", "darkviolet") by 4:5 to test integer values
)
)
# list of vectors of color values (e.g., data frame column), with respect of the correspondence between the categorical and the color columns
fun_gg_scatter(
data1=list(
L1=obs2,
L2=obs3
),
x=list(
L1="Km",
L2="Distance"
),
y=list(
L1="Time",
L2="Time_lapse"
),
categ=list(# mandatory categ argument when several color required per dataset
L1="Animal",
L2="Beast"
),
color=list(
L1=obs2$Color2,# Replace by NULL to see that different levels of grey is used per dataset (not per class of the categ argument)
L2=obs3$Color3# color of integer value can be used. Replace by NULL to see that different levels of grey is used per dataset (not per class of the categ argument)
vertical=FALSE# with log2 and log10 scales, horizontal orientation is blocked because of a bug in ggplot2 (https://github.com/tidyverse/ggplot2/issues/881)