Title: | An 'SPSS' Syntax Generator for Multi-Variable Manipulation |
---|---|
Description: | A set of functions for generating 'SPSS' syntax files from the R environment. |
Authors: | Alix Lahuec <[email protected]> |
Maintainer: | Alix Lahuec <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.8.0 |
Built: | 2025-02-27 02:45:25 UTC |
Source: | https://github.com/alixlahuec/syntaxr |
Generate SPSS 'COMPUTE' syntax to compute the CONCAT() of two (sets of) variables.
spss.compute.concat(str1, str2, names)
spss.compute.concat(str1, str2, names)
str1 |
the first argument for CONCAT(). |
str2 |
the second argument for CONCAT(). |
names |
the name(s) of the variable(s) to be created. |
spss.compute.concat("feedback", "feedback_f", "enfr.feedback") spss.compute.concat("feedback", "feedback_f", "enfr.feedback")
spss.compute.concat("feedback", "feedback_f", "enfr.feedback") spss.compute.concat("feedback", "feedback_f", "enfr.feedback")
Generate SPSS 'COMPUTE' syntax to compute the MAX() of two (sets of) variables.
spss.compute.max(var1, var2, append = "new.", ...)
spss.compute.max(var1, var2, append = "new.", ...)
var1 |
the first argument for MAX(). Used for the naming of the output variable(s). |
var2 |
the second argument for MAX(). |
append |
specifies the text that should be appended to the name(s) of the variable(s) in var1 to create the output variable(s). |
... |
any additional arguments that can be passed to functions spss.format.max and spss.format.compute |
spss.compute.max(c("dob", "income"), c("dob_f", "income_f"), append = "total.") spss.compute.max(c("dob", "income"), c("dob_f", "income_f"))
spss.compute.max(c("dob", "income"), c("dob_f", "income_f"), append = "total.") spss.compute.max(c("dob", "income"), c("dob_f", "income_f"))
Generate SPSS 'STRING' syntax and 'COMPUTE' syntax to compute the CONCAT() of two (sets of) variables.
spss.concat.new(str1, str2, append = "", name = "", ...)
spss.concat.new(str1, str2, append = "", name = "", ...)
str1 |
the first argument for CONCAT(). Used for the naming of the output variable(s). |
str2 |
the second argument for CONCAT(). |
append |
specifies the text that should be appended to the name(s) of the variable(s) in str1 to create the output variable(s). Defaults to an empty string. |
name |
specifies the name of the new String variable to be created. Defaults to an empty string ; if left unspecified, the function will use the append parameter. |
... |
any additional arguments that can be passed to functions spss.string and spss.compute.concat |
spss.concat.new(c("dob", "income"), c("dob_f", "income_f"), append = "total.") spss.concat.new(c("dob", "income"), c("dob_f", "income_f"))
spss.concat.new(c("dob", "income"), c("dob_f", "income_f"), append = "total.") spss.concat.new(c("dob", "income"), c("dob_f", "income_f"))
Generate SPSS 'COMPUTE' syntax to carry out an operation on two (sets of) variables.
spss.format.compute(output, operation)
spss.format.compute(output, operation)
output |
specifies the name(s) of the output variable(s) of COMPUTE(). |
operation |
specifies the computational operation to be carried out. |
spss.format.compute("new.var", "MAX(var1,var2)") spss.format.compute(c("dob", "comments"), c("MAX(dob,dob_f)", "CONCAT(comments,comments_f)")) spss.format.compute("string.var", "CONCAT(string1,string2)")
spss.format.compute("new.var", "MAX(var1,var2)") spss.format.compute(c("dob", "comments"), c("MAX(dob,dob_f)", "CONCAT(comments,comments_f)")) spss.format.compute("string.var", "CONCAT(string1,string2)")
Generate SPSS 'concat()' syntax for two (sets of) variables.
spss.format.concat(var1, var2)
spss.format.concat(var1, var2)
var1 |
the first argument for concat(). |
var2 |
the second argument for concat(). |
spss.format.concat(c("dob", "income"), c("dob_f", "income_f")) spss.format.concat("income", "income_f")
spss.format.concat(c("dob", "income"), c("dob_f", "income_f")) spss.format.concat("income", "income_f")
Generate SPSS 'MAX()' syntax for two (sets of) variables.
spss.format.max(var1, var2)
spss.format.max(var1, var2)
var1 |
the first argument for MAX(). |
var2 |
the second argument for MAX(). |
spss.format.max(c("dob", "income"), c("dob_f", "income_f")) spss.format.max("income", "income_f")
spss.format.max(c("dob", "income"), c("dob_f", "income_f")) spss.format.max("income", "income_f")
Generate SPSS 'RENAME' syntax to rename a (set of) variables into another.
spss.rename(values, rename)
spss.rename(values, rename)
values |
the variable(s) to be renamed. |
rename |
the name(s) to use for renaming. |
spss.rename(c("oldname1", "oldname2", "oldname3"), c("new1", "new2", "new3")) spss.rename(c("oldname1", "oldname2"), c("new1", "new2"))
spss.rename(c("oldname1", "oldname2", "oldname3"), c("new1", "new2", "new3")) spss.rename(c("oldname1", "oldname2"), c("new1", "new2"))
Generate SPSS 'RTRIM' syntax to apply RTRIM() to a string variable.
spss.rtrim(str)
spss.rtrim(str)
str |
the string argument for RTRIM(). |
spss.rtrim("variable_to_be_trimmed")
spss.rtrim("variable_to_be_trimmed")
Generate SPSS 'STRING' syntax to create a variable of type string.
spss.string(names, string.format = "A15")
spss.string(names, string.format = "A15")
names |
the name(s) of the variable(s) to be created. |
string.format |
specifies the formatting to use when creating the string variable. Defaults to "A15". |
spss.string("my.string") spss.string("long.string", string.format = "A40")
spss.string("my.string") spss.string("long.string", string.format = "A40")