Description Usage Arguments Value Examples
plot2Var takes as input a data.frame object (dfData
), two column names (plotVar1
, plotVar2
), two character strings (firstAxis
, secondAxis
)specifying the axis labels to be used respectively for the two y-axis, a character string indicating the name of the ordering variable (should be one of - plotVar1
, plotVar2
), a character string (main
) for the overall title of the plot, a character string indicating the name of the output subdirectory (subDir
), three positive numbers indicating the width (width
), height (height
) and resolution (res
) of the output plot, and a boolean variable indicating whether to save a copy of the plot as a .png file. It then generates a plot from two variables and for copy == T, saves the plot as a .png file in the "plot" directory within the current working directory. If the directory called "plot" is not present in the current working directory, a new directory called "plot" is created.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
dfData |
a data.frame object. Note that this is not a character string but the data.frame object itself. The parameter passed to the function should be without quotes (" "). |
plotVar1 |
a character string indicating the name of the column from data.frame object |
orderVar |
a character string indicating the name of the ordering variable. It is one of the two variables used to create the plot - |
ylim1 |
a numeric vector containing two values indicating the lower and upper limits of the first y-axis. |
scaleFVar3 |
a number indicating how much the third y-axis be scaled compared to the first two y-axes. |
plotVar2 |
a character string indicating the name of the column from data.frame object |
secondAxis |
a character string indicating the label for the second y-axis. |
secYaxStep |
a number indicating the difference between consecutive tick values for the second y-axis. |
ylim2 |
a numeric vector containing two values indicating the lower and upper limits of the second y-axis. |
subDir |
a character string indicating the name of the subdirectory within "output" and "plot" directories to save the output data.frame object (as a .txt file) and plot (as a .png file)respectively. If a subdirectory with the given name does not exist within output and/or plot, then it is created. If not specified, the outputs are stored in output/ and plot/. |
main |
a character string indicating an overall title for the plot. |
width |
a number (default: 1000) indicating the width of the output plot. |
height |
a number (default: 600) indicating the height of the output plot. |
res |
a number (default: 125) indicating the resolution of the output plot. |
copy |
a boolean variable (default: F) indicating whether to save the plot as a .png file or not. |
plot2Var returns a plot of 3 variables (plotVar1
, plotVar2
, plotVar3
) from the data.frame object dfData
and saves the plot as a .png file in the "plot" directory within the current working directory. If the directory called "plot" is not present in the current working directory, a new directory called "plot" is created.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.