Description Usage Arguments Value Examples
View source: R/padis_general_functions.R
This function allows the computation of some summary statistics within groups/persons or other clusters. The data needs to be in a long format. At least one variable needs to be a grouping-variable, e.g. id
. Other variables of the data frame should be numeric.
1 2 3 |
data |
The data frame in long-format that contains the variables to be analysed |
id |
Character string. The id or grouping variable, in which other observations are nested |
remove_var |
Character string. Variables that should be removed before the computation proceeds (otherwise, the function assumes that all other variables should be used for the computation) |
prefix_out |
The prefix for the variables that are returned. Default is |
intake_var |
Character string. Specific variables (e.g. names of these variables) for which the ananylses should be run, i. e. if only a subset of variables should be used. |
out_values |
The values to be returned. Can be either
|
Returns a data frame in wide format (i. e. one row per group/id). Variable names are the original variable names with a correspondng prefix and an underscore (e. g. mean_
for the mean). For the correlations, the names of the two variables that are correlated with each other are pasted together and the prefix cor
is added, e. g. cor.var_1.var_2
for the correlation between var_1
and var_2
.
1 2 3 4 | df <- aggregate_df(wide_example_data, id="id")
head(df)
data <- ssd.day
id = "PAR.ID"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.