View source: R/write_ok_selection_list.R
| write_ok_selection_list | R Documentation |
The sampling plan is output to an Excel sheet. The list with selected units is standardised and formatted in order to be submitted without further formatting.
write_ok_selection_list(
data,
sheet,
filename,
filepath,
column_standards = OKplan::OK_column_standards,
calculate_sum = TRUE,
footnote = NULL,
footnote_heights = NULL,
dbsource,
add_worksheet = FALSE,
...
)
data |
[ |
sheet |
[ |
filename |
[ |
filepath |
[ |
column_standards |
[ |
calculate_sum |
[ |
footnote |
[ |
footnote_heights |
[ |
dbsource |
[ |
add_worksheet |
[ |
... |
Other arguments to be passed to |
The data must originate from an "okplan" file and
the function uses
NVIdb::standardize_columns.
to select, order, format and style the columns. The formatting
information is either taken from OK_column_standards or
can be input as a list
When using OK_column_standards, the formatting information is
taken in accord with the argument dbsource. If the formatting
needs to be edited, it must be edited in the general source file for
column standards and thereafter, build it into a new version of OKplan.
As this can be a tedious process, there is a possibility to input the
formatting information as a list or as a csv-file that can be transformed
to a data.frame with the same columns as OK_column_standards.
The list input to column_standards must follow a specific format.
It is a list with at least three named vectors:
colname: a vector of all columns in in the source file that
should be included in the Excel report with the selection list.
collabel: A vector with the labels that should be used in the
Excel report.
colwidth: A vector with the column width that should be used
in the Excel report.
In addition one may input:
colorder: the order of the columns to be used in the Excel report.
The default is to use the same order as they are entered in the vectors.
column_db: input added as a possibility to keep on the same format
as OK_column_standards. Not necessary to input.
table_db: input added as a possibility to keep on the same format
as OK_column_standards. Must be the same as
dbsource. Not necessary to input.
All vectors must have the same order and the same length.
When calculate_sum is TRUE, a line with the sum will be appended.
The default is to calculate the sum of the column "ant_prover". If the sum
should be calculated for one or more other columns, you may give the column
names as input to the argument column that will be passed to
append_sum_line. The sum will only be appended for columns
that exist in the data.
When more than one worksheet should be added to a single workbook,
use add_worksheet = FALSE for the first worksheet and
add_worksheet = TRUE for the consecutive worksheet(s).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.