mcga: Make Column Names Great Again

Description Usage Arguments Value Examples

View source: R/mcga.r

Description

Remove punctuation and spaces and turn them to underscores plus convert to lower case.

Usage

1
mcga(tbl)

Arguments

tbl

a data.frame-like object

Value

whatver class x was but with truly great, really great column names. They're amazing. Trust me. They'll be incredible column names once we're done.

Examples

1
2
3
real_world <- read_docx(system.file("examples/realworld.docx", package="docxtractr"))
tbls <- docx_extract_all_tbls(real_world)
mcga(assign_colnames(tbls[[1]], 2))

Example output

# A tibble: 7 x 9
  country birthrate death_rate population_growpopulation_grow<chr>   <chr>     <chr>      <chr>            <chr>           
1 USA     2.06      0.51%      0.92%            -0.06%          
2 China   1.62      0.3%       0.6%             -0.58%          
3 Egypt   2.83      0.41%      2.0%             1.32%           
4 India   2.35      0.34%      1.56%            0.76%           
5 Italy   1.28      0.72%      0.35%            -1.33%          
6 Mexico  2.43      0.25%      1.41%            0.96%           
7 Nigeria 4.78      0.26%      2.46%            3.58%           
# … with 4 more variables: relative_place_in_transition <chr>,
#   social_factors_1 <chr>, social_factors_2 <chr>, social_factors_3 <chr>

docxtractr documentation built on July 8, 2020, 6:23 p.m.

Related to mcga in docxtractr...