Dapply: Dapply

Description Usage Arguments Value Examples

View source: R/dapply2.R

Description

Dapply, dapply2 ist plyr::llply()

Usage

 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
Dapply(x, ...)

dapply2(
  data,
  fun = function(x) as.numeric(x),
  stringsAsFactors = default.stringsAsFactors(),
  ...
)

## S3 method for class 'formula'
Dapply(
  x,
  data,
  fun = function(xx) {     as.numeric(xx) },
  stringsAsFactors = default.stringsAsFactors(),
  ...
)

## S3 method for class 'data.frame'
Dapply(
  data,
  ...,
  fun = function(x) as.numeric(x),
  stringsAsFactors = default.stringsAsFactors()
)

Arguments

x

Objekt

...

Weitere Argumente an llply

data

Data.frame

fun

funktion function(x) as.numeric(x)

stringsAsFactors

logical: should character vectors be converted to factors?

Value

data.frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 
df1 <- Label(data.frame(
  month = rep(1:3, 2),
  student = rep(c("Amy", "Bob"), each = 3),
  A = c(9, 7, 6, 8, 6, 9),
  B = c(6, 7, 8, 5, 6, 7)
),
A = "Deutsch",
B = "Mathe")

rs1 <- Dapply(~ A + B,
              df1,
              cut,
              breaks = 3,
              labels = c(1:3))
              

stp4/stp25aggregate documentation built on Sept. 17, 2021, 5:34 a.m.