Description Usage Arguments Details Value Methods (by class) Author(s) See Also Examples
Create a script according to the definition of the variables and a template .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | create_script(var_desc, template, rawdata_name = "raw_data",
cleandata_name = "clean_data", header = TRUE, footer = TRUE, ...)
## S4 method for signature 'VariableDef,ScriptTemplate'
create_script(var_desc, template,
rawdata_name = "raw_data", cleandata_name = "clean_data",
header = FALSE, footer = FALSE, columns_names = var_desc$rname)
## S4 method for signature 'VariableDef,character'
create_script(var_desc, template,
rawdata_name = "raw_data", cleandata_name = "clean_data", header = TRUE,
footer = TRUE, ...)
## S4 method for signature 'VariableDef,ANY'
create_script(var_desc, template,
rawdata_name = "raw_data", cleandata_name = "clean_data", header = TRUE,
footer = TRUE, ...)
## S4 method for signature 'DatabaseDef,ANY'
create_script(var_desc, template,
rawdata_name = "raw_data", cleandata_name = "clean_data", header = TRUE,
footer = TRUE, ...)
## S4 method for signature 'data.frame,ANY'
create_script(var_desc, template,
rawdata_name = "raw_data", cleandata_name = "clean_data", header = TRUE,
footer = TRUE, ...)
|
var_desc |
An object which describes the variable. Could be a single
|
template |
Optional. An object which describes the template. Either a |
rawdata_name |
Name used to replace rep_rawdata in the template |
cleandata_name |
Name used to replace rep_cleandata in the template |
header |
If |
footer |
If |
... |
others arguments for specifics methods |
columns_names |
rnames of the columns |
create_script
is the central function of the vartors
package. It will collate the two input objects created by the user (a VariableDef
object or DatabaseDef
object and a ScriptTemplate
object) and will produce the final product : the script skeleton represented by an ScriptOutput
object.
A ScriptOutput
object. This object could be written in a file with the write_file
function.
var_desc = VariableDef,template = ScriptTemplate
:
var_desc = VariableDef,template = character
:
var_desc = VariableDef,template = ANY
:
var_desc = DatabaseDef,template = ANY
:
var_desc = data.frame,template = ANY
:
Joris Muller
import_template
, import_vardef
and the general documentation of vartors.
1 2 3 4 5 6 7 8 | # Import a data.frame containing the description of the variables
# Show the description of the variable
sample_descvar
# Create the script skeleton simply with create_script()
script_skeleton <- create_script(sample_descvar)
# watch the result
script_skeleton
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.