View source: R/psychReportData.R
| normData | R Documentation | 
Aggregate data returning the mean, standard deviation, and standard error
normData(data, idvar, dvs)
| data | A dataframe | 
| idvar | Column indicating the individual participants | 
| dvs | List of numeric data columns to normalise | 
dataframe
# Example 1:
library(dplyr)
dat <- createDF(nVP = 50, nTrl = 50, design = list("Comp" = c("comp", "incomp")))
dat <- addDataDF(dat,
  RT = list(
    "Comp comp" = c(500, 80, 100),
    "Comp incomp" = c(550, 80, 140)
  ),
  Error = list(
    "Comp comp" = 5,
    "Comp incomp" = 10
  )
)
datAggVP <- dat %>%
  group_by(VP, Comp) %>%
  summarize(
    N = n(),
    RT = mean(RT[Error == 0]),
    ER = (sum(Error) / N) * 100
  )
datAggVP <- normData(datAggVP, "VP", c("RT", "ER"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.