list_to_df: list_to_df

View source: R/list_to_df.R

list_to_dfR Documentation

list_to_df

Description

list_to_df

Usage

list_to_df(
  x,
  name = make.names(gsub("_", "\\.", names(x)), TRUE),
  last = NULL
)

Arguments

x

liste mit data.frames

name

namen

last

namen

Value

tibbel

Examples


x <- list(
  M1 = data.frame(
    Source = c("Intercept", "A", "B" , "C", "Residual"),
    b = c(0, 1, 2, 3, 0),
    y = c((1:4) + 10, 0)
  ),

  M2 = data.frame(
    Source = c("Intercept", "A", "C", "B",  "D",  "E", "Residual"),
    x = c(0, 1, 3, 2, 4, 5, 0),
    y = c((1:6) + 21, 0)
  ),
  M3 = data.frame(
    Source = c("A", "B", "C", "D", "Residual"),
    x = c((1:4), 0),
    y = c((1:4) + 20, 0)
  ),

  M1 = data.frame(
    Source = c("A", "B",  "D", "Residual"),
    x = c(1, 2, 4, 0),
    y = c((1:3) + 30, 0)
  )

)

list_to_df(x, last = "Residual")

# A tibble: 7 x 9
# Source     M1_b  M1_y  M2_x  M2_y  M3_x  M3_y M1.1_x M1.1_y
#   1 Intercept     0    11     0    22    NA    NA     NA     NA
#   2 A             1    12     1    23     1    21      1     31
#   3 B             2    13     2    25     2    22      2     32
#   4 C             3    14     3    24     3    23     NA     NA
#   5 D            NA    NA     4    26     4    24      4     33
#   6 E            NA    NA     5    27    NA    NA     NA     NA
#   7 Residual      0     0     0     0     0     0      0      0


stp4/stp25tools documentation built on Feb. 27, 2025, 11:14 p.m.