Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tidyr_legacy

Legacy name repair


Description

Ensures all column names are unique using the approach found in tidyr 0.8.3 and earlier. Only use this function if you want to preserve the naming strategy, otherwise you're better off adopting the new tidyverse standard with name_repair = "universal"

Usage

tidyr_legacy(nms, prefix = "V", sep = "")

Arguments

prefix

prefix Prefix to use for unnamed column

sep

Separator to use between name and unique suffix

nm

Character vector of names

Examples

df <- tibble(x = 1:2, y = list(tibble(x = 3:5), tibble(x = 4:7)))

# Doesn't work because it would produce a data frame with two
# columns called x
## Not run: unnest(df, y)

# The new tidyverse standard:
unnest(df, y, names_repair = "universal")

# The old tidyr approach
unnest(df, y, names_repair = tidyr_legacy)

tidyr

Tidy Messy Data

v1.1.3
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.